@@ -47,7 +47,7 @@ function createWindow() {
47
47
// This method will be called when Electron has finished
48
48
// initialization and is ready to create browser windows.
49
49
// Some APIs can only be used after this event occurs.
50
- app . on ( 'ready' , createWindow )
50
+ app . on ( 'ready' , createWindow ) ;
51
51
52
52
// Quit when all windows are closed.
53
53
app . on ( 'window-all-closed' , function ( ) {
@@ -68,7 +68,7 @@ app.on('activate', function() {
68
68
// Checks to see if the directory the user chooses is writeable
69
69
ipcMain . on ( 'checkIfDirectoryExists' , ( event , file ) => {
70
70
fs . access ( file , fs . constants . R_OK , ( err ) => {
71
- console . log ( `${ file } ${ err ? 'is not readable' : 'is readable' } ` ) ;
71
+ // console.log(`${file} ${err ? 'is not readable' : 'is readable'}`);
72
72
} ) ;
73
73
} )
74
74
@@ -87,24 +87,24 @@ function sendClientAddonInfo() {
87
87
bat . stdout . on ( 'data' , ( data ) => {
88
88
var arrayOfOutput = data . toString ( ) . split ( '\n' )
89
89
var fixedArray = arrayOfOutput . slice ( 5 , arrayOfOutput . length - 3 )
90
- console . log ( fixedArray )
90
+ // console.log(fixedArray)
91
91
for ( var i = 0 ; i < fixedArray . length ; i ++ ) {
92
92
fixedArray [ i ] = fixedArray [ i ] . replace ( '/r' , '' ) ;
93
- console . log ( fixedArray )
93
+ // console.log(fixedArray)
94
94
ADDON_IDS . push ( [ fixedArray [ i ] . substr ( 0 , 11 ) . replace ( / \s / g, '' ) . toString ( ) ] )
95
95
}
96
96
97
97
if ( fixedArray == "Couldn't initialize Steam!\r" ) {
98
98
mainWindow . webContents . send ( 'errorAlert' , ADDON_IDS ) ;
99
99
}
100
- console . log ( ADDON_IDS ) ;
100
+ // console.log(ADDON_IDS);
101
101
mainWindow . webContents . send ( 'addonInfo' , ADDON_IDS ) ;
102
102
} ) ;
103
103
}
104
104
105
105
// This creates our addon.json
106
106
ipcMain . on ( 'createJsonFile' , ( event , json , dir ) => {
107
- console . log ( json , dir )
107
+ // console.log(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." ) ;
@@ -131,7 +131,7 @@ ipcMain.on('uploadToWorkshop', (event, gmaDir, iconDir, addonId) => {
131
131
const gmpublish = spawn ( settings . get ( 'gmodDirectory' ) + '\\bin\\gmpublish.exe' , [ 'update' , '-id' , addonId , '-icon' , iconDir , '-addon' , gmaDir ] ) ;
132
132
gmpublish . stdout . on ( 'data' , ( data ) => {
133
133
var arrayOfOutput = data . toString ( ) . split ( '\n' ) ;
134
- console . log ( arrayOfOutput )
134
+ // console.log(arrayOfOutput)
135
135
var fixedArray = arrayOfOutput . slice ( arrayOfOutput . length - 2 , arrayOfOutput . length - 1 ) ;
136
136
fixedArray = fixedArray [ 0 ] . replace ( / \D / , '' ) ;
137
137
fixedArray = fixedArray . substr ( 5 , fixedArray . length ) ;
@@ -142,22 +142,22 @@ ipcMain.on('uploadToWorkshop', (event, gmaDir, iconDir, addonId) => {
142
142
const gmpublish = spawn ( settings . get ( 'gmodDirectory' ) + '\\bin\\gmpublish.exe' , [ 'create' , '-icon' , iconDir , '-addon' , gmaDir ] ) ;
143
143
gmpublish . stdout . on ( 'data' , ( data ) => {
144
144
var arrayOfOutput = data . toString ( ) . split ( '\n' ) ;
145
- console . log ( arrayOfOutput )
145
+ // console.log(arrayOfOutput)
146
146
var fixedArray = arrayOfOutput . slice ( arrayOfOutput . length - 2 , arrayOfOutput . length - 1 ) ;
147
147
fixedArray = fixedArray [ 0 ] . replace ( / \D / , '' ) ;
148
148
fixedArray = fixedArray . substr ( 5 , fixedArray . length ) ;
149
149
var stringArray = fixedArray . toString ( )
150
150
var addonURLIndex = stringArray . indexOf ( "?id=" )
151
151
var addonURL = stringArray . slice ( addonURLIndex + 4 , addonURLIndex + 14 )
152
- console . log ( addonURL )
152
+ // console.log(addonURL)
153
153
mainWindow . webContents . send ( 'currentAddonID' , addonURL ) ;
154
154
} ) ;
155
155
} ;
156
156
} ) ;
157
157
158
158
// This will extract a GMA file to GarrysMod/garrysmod/addons/[addon_name]
159
159
ipcMain . on ( "extractAddon" , ( e , path ) => {
160
- console . log ( e , path ) ;
160
+ // console.log(e, path);
161
161
const gmad = spawn ( settings . get ( 'gmodDirectory' ) + '\\bin\\gmad.exe' , [ 'extract' , '-file' , path ] ) ;
162
162
mainWindow . webContents . send ( "finishExtraction" ) ;
163
163
} ) ;
0 commit comments