add webi to npm as @root/webi@v0.5.0

This commit is contained in:
AJ ONeal
2020-07-14 00:36:44 -06:00
parent d61215ff5a
commit acacb6d62c
5 changed files with 153 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
# [webi](https://webinstall.dev)
Effortlessly install developer tools with easy-to-remember URLs.
`webi` is an easy-to-remember cross-platform way to
- install things quickly
- without being `root` or Admin
- without touching system files or permissions
- without looking up docs
## Example: Installing node
Mac & Linux:
```bash
curl -fsS https://webinstall.dev/node | bash
```
Windows 10 (includes `curl.exe` and PowerShell by default):
```bash
curl.exe -fsSA "MS" https://webinstall.dev/node | powershell
```
## Example: Switching node versions
```bash
webi node@stable
webi node@lts
webi node@v10
```
## Meta Package
This is a meta package for [webi™](https://webinstall.dev/webi).
+30
View File
@@ -0,0 +1,30 @@
'use strict';
var pkg = require('../package.json');
var spawn = require('child_process').spawn;
var os = require('os');
var path = require('path');
function spawner(args) {
return new Promise(function (resolve, reject) {
var bin = args.shift();
var runner = spawn(bin, args, {
windowsHide: true
});
runner.stdout.on('data', function (chunk) {
console.info(chunk.toString('utf8'));
});
runner.stderr.on('data', function (chunk) {
console.error(chunk.toString('utf8'));
});
runner.on('exit', function (code) {
if (0 !== code) {
reject(new Error("exited with non-zero status code '" + code + "'"));
return;
}
resolve({ code: code });
});
});
}
module.exports = spawner;
+13
View File
@@ -0,0 +1,13 @@
{
"name": "@root/webi",
"version": "0.5.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@root/request": {
"version": "1.6.1",
"resolved": "https://registry.npmjs.org/@root/request/-/request-1.6.1.tgz",
"integrity": "sha512-8wrWyeBLRp7T8J36GkT3RODJ6zYmL0/maWlAUD5LOXT28D3TDquUepyYDKYANNA3Gc8R5ZCgf+AXvSTYpJEWwQ=="
}
}
}
+28
View File
@@ -0,0 +1,28 @@
{
"name": "@root/webi",
"version": "0.5.0",
"description": "Effortlessly install developer tools with easy-to-remember URLs",
"main": "index.js",
"homepage": "https://webinstall.dev",
"files": [
"scripts/"
],
"scripts": {
"postinstall": "node scripts/webi.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/webinstall/packages"
},
"keywords": [
"webi",
"webinstall",
"install"
],
"author": "AJ ONeal <coolaj86@gmail.com> (https://coolaj86.com/)",
"license": "MPL-2.0",
"dependencies": {
"@root/request": "^1.6.1"
}
}
+46
View File
@@ -0,0 +1,46 @@
#!/usr/bin/env node
'use strict';
//var pkg = require('../package.json');
var os = require('os');
//var request = require('@root/request');
//var promisify = require('util').promisify;
//var exec = promisify(require('child_process').exec);
var exec = require('child_process').exec;
if (/^win/i.test(os.platform())) {
console.warn('');
console.warn("This npm installer doesn't work on windows yet.");
console.warn('Copy and paste this into cmd.exe or PowerShell instead:');
console.warn('');
console.warn(
" curl.exe -fsSA 'MS' https://webinstall.dev/webi | powershell"
);
console.warn('');
return;
}
exec('curl -fsS https://webinstall.dev/webi | bash', function (
err,
stdout,
stderr
) {
if (err) {
console.error(err);
}
if (stdout) {
console.info(stdout);
}
if (stderr) {
console.error(stderr);
}
});
/*
.then(function () {
// nada
})
.catch(function (err) {
console.error(err);
});
*/