diff --git a/setup.js b/setup.js index 61618d034..ccca81c45 100644 --- a/setup.js +++ b/setup.js @@ -9,7 +9,7 @@ let nodeModulesDirs = [ path.join( process.cwd(), "Projects", "Superalgos", "TS", "Bot-Modules", "Trading-Bot", "Announcements"), path.join( process.cwd(), "Projects", "Superalgos", "TS", "Bot-Modules", "Trading-Bot", "Low-Frequency-Trading", "APIs"), path.join( process.cwd(), "Projects", "Superalgos", "TS", "Task-Modules"), - path.join( process.cwd(), "Projects", "TensorFlow", "TS", "Bot-Modules") + path.join( process.cwd(), "Projects", "TensorFlow", "TS", "Bot-Modules", "Learning-Bot", "Low-Frequency-Learning") ]; console.log(''); @@ -18,32 +18,37 @@ console.log(''); console.log(nodeModulesDirs); console.log(''); -// Loop through directories and run node ci in a child process shell. + let dir; +let ifError; for (dir in nodeModulesDirs) { - let command = "npm ci"; + // Loop through directories and run node ci in a child process shell. + let command = "echo Results of install at "+ nodeModulesDirs[dir] + " & npm ci"; exec( command, { cwd: nodeModulesDirs[dir] }, - function ( error, stdout, stderr ){ + function ( error, stdout ){ if (error) { - console.log("there was an error: ", error); + console.log(''); + console.log("There was an error installing some dependencies error: "); + console.log(''); + console.log( error ); + ifError = true; return; } - console.log( "Results of install at " + nodeModulesDirs[dir] ); console.log(''); console.log( stdout ); }); -}; -/* - cd %~dp0 - cd .. - cd %%a - cmd /k "npm ci" -)) - -REM cmd /k "cd %~dp0 && cd .." -REM cmd /k "npm ci && cd %~dp0" -REM cmd /k "npm ci" -*/ \ No newline at end of file + + // Print closing message + if (dir == nodeModulesDirs.length) { + if ( ifError = true ) { + console.log(''); + console.log("Installation of node dependencies finished with errors. See error messages above.") + } else { + console.log(''); + console.log("Node dependencies installed successfully!") + } + } +}; \ No newline at end of file