"Fossies" - the Fresh Open Source Software Archive

Member "Atom/resources/app/apm/script/check-version.js" (8 Mar 2017, 892 Bytes) of archive /windows/misc/atom-windows.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Javascript source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/usr/bin/env node
    2 
    3 var path = require('path');
    4 
    5 var getBundledNodeVersion = require('./bundled-node-version')
    6 
    7 var bundledNodePath = path.join(__dirname, '..', 'bin', 'node')
    8 if (process.platform === 'win32') {
    9   bundledNodePath += '.exe'
   10 }
   11 
   12 getBundledNodeVersion(bundledNodePath, function(err, bundledVersion) {
   13   if (err) {
   14     console.error(err);
   15     process.exit(1);
   16   }
   17 
   18   var ourVersion = process.version
   19 
   20   if (ourVersion !== bundledVersion) {
   21     console.error('System node (' + ourVersion + ') does not match bundled node (' + bundledVersion + ').');
   22     if (process.platform === 'win32') {
   23       console.error('Please use `.\\bin\\node.exe` to run node, and use `.\\bin\\npm.cmd` to run npm scripts.')
   24     } else {
   25       console.error('Please use `./bin/node` to run node, and use `./bin/npm` to run npm scripts.')
   26     }
   27     process.exit(1)
   28   } else {
   29     process.exit(0)
   30   }
   31 });