0718c1f3827756cce5c65d22ffb6833e9e0d713c
[webi-installers/.git] / _npm / scripts / install-webi.js
1 #!/usr/bin/env node
2
3 'use strict';
4
5 //var pkg = require('../package.json');
6 var os = require('os');
7 //var request = require('@root/request');
8 //var promisify = require('util').promisify;
9 //var exec = promisify(require('child_process').exec);
10 var exec = require('child_process').exec;
11
12 if (/^win/i.test(os.platform())) {
13   console.warn('');
14   console.warn("This npm installer doesn't work on windows yet.");
15   console.warn('Copy and paste this into cmd.exe or PowerShell instead:');
16   console.warn('');
17   console.warn(
18     "    curl.exe -fsSA 'MS' https://webinstall.dev/webi | powershell"
19   );
20   console.warn('');
21   return;
22 }
23
24 exec('curl -fsS https://webinstall.dev/webi | bash', function (
25   err,
26   stdout,
27   stderr
28 ) {
29   if (err) {
30     console.error(err);
31   }
32   if (stdout) {
33     console.info(stdout);
34   }
35   if (stderr) {
36     console.error(stderr);
37   }
38 });
39 /*
40   .then(function () {
41     // nada
42   })
43   .catch(function (err) {
44     console.error(err);
45   });
46 */