diff --git a/Launch-Scripts/system-check.js b/Launch-Scripts/system-check.js new file mode 100644 index 000000000..27ca73332 --- /dev/null +++ b/Launch-Scripts/system-check.js @@ -0,0 +1,69 @@ +const { execSync } = require("child_process"); +const os = require("os"); + +// Minimum versions required +const npmNeededVersion = '5' +const nodeNeededVersion = '12' +const gitNeededVersion = '2' + +function systemCheck () { + try { + + // Gather Installed Versions of Node, NPM and Git + const npmVersionRaw = execSync( "npm -v",{ encoding: 'utf8', timeout: 30000 }) + const nodeVersionRaw = execSync( "node -v",{ encoding: 'utf8',timeout: 30000 }) + const gitVersionRaw = execSync( "git --version",{ encoding: 'utf8',timeout: 30000 }) + const npmVersion = npmVersionRaw.trim().split('.') + const nodeVersion = nodeVersionRaw.trim().substring(1).split('.') + const gitVersion = gitVersionRaw.trim().split(' ')[2].split('.') + + // Make sure update version of npm is installed + if ( npmVersion[0] < npmNeededVersion ) { + console.log(''); + console.log("ERROR: the version of npm you have installed is out of date. Please update your installation of npm and try again."); + console.log(''); + process.exit(); + } + + // Make sure update version of node is installed + if ( nodeVersion[0] < nodeNeededVersion ) { + console.log(''); + console.log("ERROR: the version of node you have installed is out of date. Please update your installation of node and try again."); + console.log(''); + process.exit(); + } + + // Make sure updated version of git is installed + if ( gitVersion[0] < gitNeededVersion ) { + console.log(''); + console.log("ERROR: the version of git you have installed is out of date. Please update your installation of git and try again."); + console.log(''); + process.exit(); + } + + // Check windows system + if (os.platform() == "win32") { + + // Verify C:\Windows\System32 is on the windows PATH + const path = execSync( "echo %PATH%",{ encoding: 'utf8',timeout: 30000 }) + let check = path.includes('System32') + if ( check === false ) { + console.log(''); + console.log("ERROR: it appears C:\\Windows\\System32 is missing from your PATH. Please add to your path and try again."); + console.log(''); + process.exit(); + } + + } + + } catch (error) { + console.log(''); + console.log("There was an error with your system: "); + console.log(''); + console.log( error ); + return; + } + +}; + +module.exports = systemCheck \ No newline at end of file diff --git a/Projects/Foundations/Schemas/Docs-Tutorials/H/How/How-to-aggregate-data-from-different-Exchanges-in-the-same-Chart-/how-to-aggregate-data-from-different-exchanges-in-the-same-chart-001-how-to-combine-exchanges-in-a-chart-tutorial.json b/Projects/Foundations/Schemas/Docs-Tutorials/A/aggregate-data-from-different-exchanges-in-a-chart/aggregate-data-from-different-exchanges-in-a-chart-001-combine-exchanges-in-a-chart-tutorial.json similarity index 77% rename from Projects/Foundations/Schemas/Docs-Tutorials/H/How/How-to-aggregate-data-from-different-Exchanges-in-the-same-Chart-/how-to-aggregate-data-from-different-exchanges-in-the-same-chart-001-how-to-combine-exchanges-in-a-chart-tutorial.json rename to Projects/Foundations/Schemas/Docs-Tutorials/A/aggregate-data-from-different-exchanges-in-a-chart/aggregate-data-from-different-exchanges-in-a-chart-001-combine-exchanges-in-a-chart-tutorial.json index 4f33607d8..2e9eb3a54 100644 --- a/Projects/Foundations/Schemas/Docs-Tutorials/H/How/How-to-aggregate-data-from-different-Exchanges-in-the-same-Chart-/how-to-aggregate-data-from-different-exchanges-in-the-same-chart-001-how-to-combine-exchanges-in-a-chart-tutorial.json +++ b/Projects/Foundations/Schemas/Docs-Tutorials/A/aggregate-data-from-different-exchanges-in-a-chart/aggregate-data-from-different-exchanges-in-a-chart-001-combine-exchanges-in-a-chart-tutorial.json @@ -1,7 +1,7 @@ { - "tutorial": "How to aggregate data from different Exchanges in the same Chart ", + "tutorial": "Aggregate data from different Exchanges in a Chart ", "pageNumber": "1", - "type": "How to combine Exchanges in a Chart Tutorial", + "type": "Combine Exchanges in a Chart Tutorial", "definition": { "text": "This Tutorial covers the process of pulling together the most diverse set of data: data from different exchanges! By the end of this tutorial you will be able to build charts almost impossible to find anywhere else.", "updated": 1617376996248 diff --git a/run.js b/run.js index 3ad96de94..55353f22c 100644 --- a/run.js +++ b/run.js @@ -96,7 +96,7 @@ if ( fs.existsSync(path) ) { } } else { console.log('') - console.log('ERROR: node_modules does not exist. Try running node setup to solve this issue. Then try again.') + console.log('ERROR: node_modules does not exist. Try running node setup to solve this issue. Then try again. You can finded detailed instructions for this in the ReadMe.') console.log('') } diff --git a/setup.js b/setup.js index 88e035833..e729a2307 100644 --- a/setup.js +++ b/setup.js @@ -1,6 +1,10 @@ const path = require("path"); const process = require("process"); const { exec } = require("child_process"); +const systemCheck = require('./Launch-Scripts/system-check') + +// Check system is set up correctly +systemCheck(); // Handle adding shortcuts if (process.argv.includes("noShortcuts")) {