lib/utils.js
function ensureWindows () {
  if (process.platform !== 'win32') {
    log('This tool requires Windows 10.\n')
    log('You can run a virtual machine using the free VirtualBox and')
    log('the free Windows Virtual Machines found at http://modern.ie.\n')
    log('For more information, please see the readme.')
    process.exit(1)
  }

  let release = require('os').release()
  let major = parseInt(release.slice(0, 2), 10)
  let minor = parseInt(release.slice(3, 4), 10)
  let build = parseInt(release.slice(5), 10)

  if (major < 10 || (minor === 0 && build < 14316)) {
    log(`You are running Windows ${release}. You need at least Windows 10.0.14316.`)
    log('We can\'t confirm that you\'re running the right version, but we won\'t stop')
    log('this process - should things fail though, you might have to update your')
    log('Windows.')
  }
}
function ensureWindows () {
  if (process.platform !== 'win32') {
    log('This tool requires Windows 10.\n')
    log('You can run a virtual machine using the free VirtualBox and')
    log('the free Windows Virtual Machines found at http://modern.ie.\n')
    log('For more information, please see the readme.')
    process.exit(1)
  }

  let release = require('os').release()
  let major = parseInt(release.slice(0, 2), 10)
  let minor = parseInt(release.slice(3, 4), 10)
  let build = parseInt(release.slice(5), 10)

  if (major < 10 || (minor === 0 && build < 14316)) {
    log(`You are running Windows ${release}. You need at least Windows 10.0.14316.`)
    log('We can\'t confirm that you\'re running the right version, but we won\'t stop')
    log('this process - should things fail though, you might have to update your')
    log('Windows.')
  }
}
function ensureWindows ( ) { if ( process . platform !== 'win32' ) { log ( 'This tool requires Windows 10.\n' ) log ( 'You can run a virtual machine using the free VirtualBox and' ) log ( 'the free Windows Virtual Machines found at http://modern.ie.\n' ) log ( 'For more information, please see the readme.' ) process . exit ( 1 ) } let release = require ( 'os' ) . release ( ) let major = parseInt ( release . slice ( 0 , 2 ) , 10 ) let minor = parseInt ( release . slice ( 3 , 4 ) , 10 ) let build = parseInt ( release . slice ( 5 ) , 10 ) if ( major < 10 || ( minor === 0 && build < 14316 ) ) { log ( ` ${ release } ` ) log ( 'We can\'t confirm that you\'re running the right version, but we won\'t stop' ) log ( 'this process - should things fail though, you might have to update your' ) log ( 'Windows.' ) } }
Ensures that the currently running platform is Windows,
exiting the process if it is not
Ensures that the currently running platform is Windows exiting the process if it is not