@@ -78,12 +78,12 @@ ipcMain.on('checkIfDirectoryExists', (event, file) => {
78
78
} )
79
79
80
80
ipcMain . on ( 'getAddonInfo' , ( ) => {
81
- console . log ( 'Trying to get addon info...' )
82
- sendClientAddonInfo ( )
83
- console . log ( "User's Gmod Directory:" + settings . get ( 'gmodDirectory' ) )
81
+ console . log ( 'Trying to get addon info...' ) ;
82
+ sendClientAddonInfo ( ) ;
83
+ console . log ( "User's Gmod Directory:" + settings . get ( 'gmodDirectory' ) ) ;
84
84
} )
85
85
86
- var ADDON_IDS = [ ]
86
+ var ADDON_IDS = [ ] ;
87
87
88
88
// We use this to get the addon IDs from gmpublish.exe
89
89
@@ -108,8 +108,8 @@ ipcMain.on('createJsonFile', (event, json, dir) => {
108
108
fs . writeFileSync ( dir + "\\addon.json" , json , 'utf8' , ( err ) => {
109
109
console . log ( "An error occured while writing JSON Object to File.\n" , err ) ;
110
110
mainWindow . webContents . send ( 'error' , "Error writing directory." ) ;
111
- } )
112
- } )
111
+ } ) ;
112
+ } ) ;
113
113
114
114
ipcMain . on ( 'createGMAFile' , ( event , addonDir ) => {
115
115
console . log ( "Addon's Directory: " + addonDir . toString ( ) )
@@ -128,21 +128,21 @@ ipcMain.on('uploadToWorkshop', (event, gmaDir, iconDir, addonId) => {
128
128
if ( addonId != null ) {
129
129
const gmpublish = spawn ( settings . get ( 'gmodDirectory' ) + '\\bin\\gmpublish.exe' , [ 'update' , '-id' , addonId , '-icon' , iconDir , '-addon' , gmaDir ] ) ;
130
130
gmpublish . stdout . on ( 'data' , ( data ) => {
131
- var arrayOfOutput = data . toString ( ) . split ( '\n' )
132
- var fixedArray = arrayOfOutput . slice ( arrayOfOutput . length - 8 , arrayOfOutput . length - 7 )
133
- fixedArray = fixedArray [ 0 ] . replace ( / \D / , '' )
134
- fixedArray = fixedArray . substr ( 5 , fixedArray . length )
135
- console . log ( fixedArray )
131
+ var arrayOfOutput = data . toString ( ) . split ( '\n' ) ;
132
+ var fixedArray = arrayOfOutput . slice ( arrayOfOutput . length - 8 , arrayOfOutput . length - 7 ) ;
133
+ fixedArray = fixedArray [ 0 ] . replace ( / \D / , '' ) ;
134
+ fixedArray = fixedArray . substr ( 5 , fixedArray . length ) ;
135
+ console . log ( fixedArray ) ;
136
136
mainWindow . webContents . send ( 'currentAddonID' , fixedArray ) ;
137
137
} ) ;
138
138
} else {
139
139
const gmpublish = spawn ( settings . get ( 'gmodDirectory' ) + '\\bin\\gmpublish.exe' , [ 'create' , '-icon' , iconDir , '-addon' , gmaDir ] ) ;
140
140
gmpublish . stdout . on ( 'data' , ( data ) => {
141
- var arrayOfOutput = data . toString ( ) . split ( '\n' )
142
- var fixedArray = arrayOfOutput . slice ( arrayOfOutput . length - 8 , arrayOfOutput . length - 7 )
143
- fixedArray = fixedArray [ 0 ] . replace ( / \D / , '' )
144
- fixedArray = fixedArray . substr ( 5 , fixedArray . length )
145
- console . log ( fixedArray )
141
+ var arrayOfOutput = data . toString ( ) . split ( '\n' ) ;
142
+ var fixedArray = arrayOfOutput . slice ( arrayOfOutput . length - 8 , arrayOfOutput . length - 7 ) ;
143
+ fixedArray = fixedArray [ 0 ] . replace ( / \D / , '' ) ;
144
+ fixedArray = fixedArray . substr ( 5 , fixedArray . length ) ;
145
+ console . log ( fixedArray ) ;
146
146
mainWindow . webContents . send ( 'currentAddonID' , fixedArray ) ;
147
147
} ) ;
148
148
} ;
0 commit comments