mirror of
https://kevinblog.sytes.net/Code/Jibo-Revival-Group/jibo-cli.git
synced 2026-06-15 10:26:20 +00:00
Initial commit — jibo-cli v3.0.7 with bundled node_modules
This commit is contained in:
13
node_modules/osenv/.npmignore
generated
vendored
Normal file
13
node_modules/osenv/.npmignore
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
*.swp
|
||||
.*.swp
|
||||
|
||||
.DS_Store
|
||||
*~
|
||||
.project
|
||||
.settings
|
||||
npm-debug.log
|
||||
coverage.html
|
||||
.idea
|
||||
lib-cov
|
||||
|
||||
node_modules
|
||||
9
node_modules/osenv/.travis.yml
generated
vendored
Normal file
9
node_modules/osenv/.travis.yml
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
language: node_js
|
||||
language: node_js
|
||||
node_js:
|
||||
- '0.8'
|
||||
- '0.10'
|
||||
- '0.12'
|
||||
- 'iojs'
|
||||
before_install:
|
||||
- npm install -g npm@latest
|
||||
15
node_modules/osenv/LICENSE
generated
vendored
Normal file
15
node_modules/osenv/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
The ISC License
|
||||
|
||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
63
node_modules/osenv/README.md
generated
vendored
Normal file
63
node_modules/osenv/README.md
generated
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
# osenv
|
||||
|
||||
Look up environment settings specific to different operating systems.
|
||||
|
||||
## Usage
|
||||
|
||||
```javascript
|
||||
var osenv = require('osenv')
|
||||
var path = osenv.path()
|
||||
var user = osenv.user()
|
||||
// etc.
|
||||
|
||||
// Some things are not reliably in the env, and have a fallback command:
|
||||
var h = osenv.hostname(function (er, hostname) {
|
||||
h = hostname
|
||||
})
|
||||
// This will still cause it to be memoized, so calling osenv.hostname()
|
||||
// is now an immediate operation.
|
||||
|
||||
// You can always send a cb, which will get called in the nextTick
|
||||
// if it's been memoized, or wait for the fallback data if it wasn't
|
||||
// found in the environment.
|
||||
osenv.hostname(function (er, hostname) {
|
||||
if (er) console.error('error looking up hostname')
|
||||
else console.log('this machine calls itself %s', hostname)
|
||||
})
|
||||
```
|
||||
|
||||
## osenv.hostname()
|
||||
|
||||
The machine name. Calls `hostname` if not found.
|
||||
|
||||
## osenv.user()
|
||||
|
||||
The currently logged-in user. Calls `whoami` if not found.
|
||||
|
||||
## osenv.prompt()
|
||||
|
||||
Either PS1 on unix, or PROMPT on Windows.
|
||||
|
||||
## osenv.tmpdir()
|
||||
|
||||
The place where temporary files should be created.
|
||||
|
||||
## osenv.home()
|
||||
|
||||
No place like it.
|
||||
|
||||
## osenv.path()
|
||||
|
||||
An array of the places that the operating system will search for
|
||||
executables.
|
||||
|
||||
## osenv.editor()
|
||||
|
||||
Return the executable name of the editor program. This uses the EDITOR
|
||||
and VISUAL environment variables, and falls back to `vi` on Unix, or
|
||||
`notepad.exe` on Windows.
|
||||
|
||||
## osenv.shell()
|
||||
|
||||
The SHELL on Unix, which Windows calls the ComSpec. Defaults to 'bash'
|
||||
or 'cmd'.
|
||||
24
node_modules/osenv/node_modules/os-homedir/index.js
generated
vendored
Normal file
24
node_modules/osenv/node_modules/os-homedir/index.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
'use strict';
|
||||
var os = require('os');
|
||||
|
||||
function homedir() {
|
||||
var env = process.env;
|
||||
var home = env.HOME;
|
||||
var user = env.LOGNAME || env.USER || env.LNAME || env.USERNAME;
|
||||
|
||||
if (process.platform === 'win32') {
|
||||
return env.USERPROFILE || env.HOMEDRIVE + env.HOMEPATH || home || null;
|
||||
}
|
||||
|
||||
if (process.platform === 'darwin') {
|
||||
return home || (user ? '/Users/' + user : null);
|
||||
}
|
||||
|
||||
if (process.platform === 'linux') {
|
||||
return home || (process.getuid() === 0 ? '/root' : (user ? '/home/' + user : null));
|
||||
}
|
||||
|
||||
return home || null;
|
||||
}
|
||||
|
||||
module.exports = typeof os.homedir === 'function' ? os.homedir : homedir;
|
||||
21
node_modules/osenv/node_modules/os-homedir/license
generated
vendored
Normal file
21
node_modules/osenv/node_modules/os-homedir/license
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
73
node_modules/osenv/node_modules/os-homedir/package.json
generated
vendored
Normal file
73
node_modules/osenv/node_modules/os-homedir/package.json
generated
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
{
|
||||
"_from": "os-homedir@>=1.0.0 <2.0.0",
|
||||
"_id": "os-homedir@1.0.2",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-B5JU3cabzk8c67mRRd3ECmROafjYMXbuzlwtqdM8IbS8ktlTix8aFGb2bAGKrSRIlnfKwovGUUr72JUPyOb6kQ==",
|
||||
"_location": "/osenv/os-homedir",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "os-homedir@1.0.2",
|
||||
"name": "os-homedir",
|
||||
"escapedName": "os-homedir",
|
||||
"rawSpec": "1.0.2",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.0.2"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/osenv"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
|
||||
"_shasum": "ffbc4988336e0e833de0c168c7ef152121aa7fb3",
|
||||
"_spec": "os-homedir@1.0.2",
|
||||
"_where": "/tmp/jibo-npm/jibo-cli-3.0.7",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/sindresorhus/os-homedir/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "Node.js 4 `os.homedir()` ponyfill",
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"path-exists": "^2.0.0",
|
||||
"xo": "^0.16.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/sindresorhus/os-homedir#readme",
|
||||
"keywords": [
|
||||
"builtin",
|
||||
"core",
|
||||
"ponyfill",
|
||||
"polyfill",
|
||||
"shim",
|
||||
"os",
|
||||
"homedir",
|
||||
"home",
|
||||
"dir",
|
||||
"directory",
|
||||
"folder",
|
||||
"user",
|
||||
"path"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "os-homedir",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/sindresorhus/os-homedir.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"version": "1.0.2"
|
||||
}
|
||||
31
node_modules/osenv/node_modules/os-homedir/readme.md
generated
vendored
Normal file
31
node_modules/osenv/node_modules/os-homedir/readme.md
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
# os-homedir [](https://travis-ci.org/sindresorhus/os-homedir)
|
||||
|
||||
> Node.js 4 [`os.homedir()`](https://nodejs.org/api/os.html#os_os_homedir) [ponyfill](https://ponyfill.com)
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save os-homedir
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const osHomedir = require('os-homedir');
|
||||
|
||||
console.log(osHomedir());
|
||||
//=> '/Users/sindresorhus'
|
||||
```
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [user-home](https://github.com/sindresorhus/user-home) - Same as this module but caches the result
|
||||
- [home-or-tmp](https://github.com/sindresorhus/home-or-tmp) - Get the user home directory with fallback to the system temp directory
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
25
node_modules/osenv/node_modules/os-tmpdir/index.js
generated
vendored
Normal file
25
node_modules/osenv/node_modules/os-tmpdir/index.js
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
'use strict';
|
||||
var isWindows = process.platform === 'win32';
|
||||
var trailingSlashRe = isWindows ? /[^:]\\$/ : /.\/$/;
|
||||
|
||||
// https://github.com/nodejs/node/blob/3e7a14381497a3b73dda68d05b5130563cdab420/lib/os.js#L25-L43
|
||||
module.exports = function () {
|
||||
var path;
|
||||
|
||||
if (isWindows) {
|
||||
path = process.env.TEMP ||
|
||||
process.env.TMP ||
|
||||
(process.env.SystemRoot || process.env.windir) + '\\temp';
|
||||
} else {
|
||||
path = process.env.TMPDIR ||
|
||||
process.env.TMP ||
|
||||
process.env.TEMP ||
|
||||
'/tmp';
|
||||
}
|
||||
|
||||
if (trailingSlashRe.test(path)) {
|
||||
path = path.slice(0, -1);
|
||||
}
|
||||
|
||||
return path;
|
||||
};
|
||||
21
node_modules/osenv/node_modules/os-tmpdir/license
generated
vendored
Normal file
21
node_modules/osenv/node_modules/os-tmpdir/license
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
73
node_modules/osenv/node_modules/os-tmpdir/package.json
generated
vendored
Normal file
73
node_modules/osenv/node_modules/os-tmpdir/package.json
generated
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
{
|
||||
"_from": "os-tmpdir@>=1.0.0 <2.0.0",
|
||||
"_id": "os-tmpdir@1.0.2",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==",
|
||||
"_location": "/osenv/os-tmpdir",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "os-tmpdir@1.0.2",
|
||||
"name": "os-tmpdir",
|
||||
"escapedName": "os-tmpdir",
|
||||
"rawSpec": "1.0.2",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.0.2"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/osenv"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
|
||||
"_shasum": "bbe67406c79aa85c5cfec766fe5734555dfa1274",
|
||||
"_spec": "os-tmpdir@1.0.2",
|
||||
"_where": "/tmp/jibo-npm/jibo-cli-3.0.7",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/sindresorhus/os-tmpdir/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "Node.js os.tmpdir() ponyfill",
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"xo": "^0.16.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/sindresorhus/os-tmpdir#readme",
|
||||
"keywords": [
|
||||
"built-in",
|
||||
"core",
|
||||
"ponyfill",
|
||||
"polyfill",
|
||||
"shim",
|
||||
"os",
|
||||
"tmpdir",
|
||||
"tempdir",
|
||||
"tmp",
|
||||
"temp",
|
||||
"dir",
|
||||
"directory",
|
||||
"env",
|
||||
"environment"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "os-tmpdir",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/sindresorhus/os-tmpdir.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"version": "1.0.2"
|
||||
}
|
||||
32
node_modules/osenv/node_modules/os-tmpdir/readme.md
generated
vendored
Normal file
32
node_modules/osenv/node_modules/os-tmpdir/readme.md
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
# os-tmpdir [](https://travis-ci.org/sindresorhus/os-tmpdir)
|
||||
|
||||
> Node.js [`os.tmpdir()`](https://nodejs.org/api/os.html#os_os_tmpdir) [ponyfill](https://ponyfill.com)
|
||||
|
||||
Use this instead of `require('os').tmpdir()` to get a consistent behavior on different Node.js versions (even 0.8).
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save os-tmpdir
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const osTmpdir = require('os-tmpdir');
|
||||
|
||||
osTmpdir();
|
||||
//=> '/var/folders/m3/5574nnhn0yj488ccryqr7tc80000gn/T'
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
See the [`os.tmpdir()` docs](https://nodejs.org/api/os.html#os_os_tmpdir).
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
72
node_modules/osenv/osenv.js
generated
vendored
Normal file
72
node_modules/osenv/osenv.js
generated
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
var isWindows = process.platform === 'win32'
|
||||
var path = require('path')
|
||||
var exec = require('child_process').exec
|
||||
var osTmpdir = require('os-tmpdir')
|
||||
var osHomedir = require('os-homedir')
|
||||
|
||||
// looking up envs is a bit costly.
|
||||
// Also, sometimes we want to have a fallback
|
||||
// Pass in a callback to wait for the fallback on failures
|
||||
// After the first lookup, always returns the same thing.
|
||||
function memo (key, lookup, fallback) {
|
||||
var fell = false
|
||||
var falling = false
|
||||
exports[key] = function (cb) {
|
||||
var val = lookup()
|
||||
if (!val && !fell && !falling && fallback) {
|
||||
fell = true
|
||||
falling = true
|
||||
exec(fallback, function (er, output, stderr) {
|
||||
falling = false
|
||||
if (er) return // oh well, we tried
|
||||
val = output.trim()
|
||||
})
|
||||
}
|
||||
exports[key] = function (cb) {
|
||||
if (cb) process.nextTick(cb.bind(null, null, val))
|
||||
return val
|
||||
}
|
||||
if (cb && !falling) process.nextTick(cb.bind(null, null, val))
|
||||
return val
|
||||
}
|
||||
}
|
||||
|
||||
memo('user', function () {
|
||||
return ( isWindows
|
||||
? process.env.USERDOMAIN + '\\' + process.env.USERNAME
|
||||
: process.env.USER
|
||||
)
|
||||
}, 'whoami')
|
||||
|
||||
memo('prompt', function () {
|
||||
return isWindows ? process.env.PROMPT : process.env.PS1
|
||||
})
|
||||
|
||||
memo('hostname', function () {
|
||||
return isWindows ? process.env.COMPUTERNAME : process.env.HOSTNAME
|
||||
}, 'hostname')
|
||||
|
||||
memo('tmpdir', function () {
|
||||
return osTmpdir()
|
||||
})
|
||||
|
||||
memo('home', function () {
|
||||
return osHomedir()
|
||||
})
|
||||
|
||||
memo('path', function () {
|
||||
return (process.env.PATH ||
|
||||
process.env.Path ||
|
||||
process.env.path).split(isWindows ? ';' : ':')
|
||||
})
|
||||
|
||||
memo('editor', function () {
|
||||
return process.env.EDITOR ||
|
||||
process.env.VISUAL ||
|
||||
(isWindows ? 'notepad.exe' : 'vi')
|
||||
})
|
||||
|
||||
memo('shell', function () {
|
||||
return isWindows ? process.env.ComSpec || 'cmd'
|
||||
: process.env.SHELL || 'bash'
|
||||
})
|
||||
67
node_modules/osenv/package.json
generated
vendored
Normal file
67
node_modules/osenv/package.json
generated
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
{
|
||||
"_from": "osenv@>=0.1.3 <0.2.0",
|
||||
"_id": "osenv@0.1.4",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-W6FhbLxEWdiyX2/fCl2YBZUJOYWaCHJa+jJwUVMX0iFYJmwyd0uzKx4NxFdj3xo9C0pumQ6G/fvd1MbNhsqQbQ==",
|
||||
"_location": "/osenv",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "osenv@0.1.4",
|
||||
"name": "osenv",
|
||||
"escapedName": "osenv",
|
||||
"rawSpec": "0.1.4",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "0.1.4"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.4.tgz",
|
||||
"_shasum": "42fe6d5953df06c8064be6f176c3d05aaaa34644",
|
||||
"_spec": "osenv@0.1.4",
|
||||
"_where": "/tmp/jibo-npm/jibo-cli-3.0.7",
|
||||
"author": {
|
||||
"name": "Isaac Z. Schlueter",
|
||||
"email": "i@izs.me",
|
||||
"url": "http://blog.izs.me/"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/npm/osenv/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"os-homedir": "^1.0.0",
|
||||
"os-tmpdir": "^1.0.0"
|
||||
},
|
||||
"deprecated": "This package is no longer supported.",
|
||||
"description": "Look up environment settings specific to different operating systems",
|
||||
"devDependencies": {
|
||||
"tap": "^8.0.1"
|
||||
},
|
||||
"directories": {
|
||||
"test": "test"
|
||||
},
|
||||
"homepage": "https://github.com/npm/osenv#readme",
|
||||
"keywords": [
|
||||
"environment",
|
||||
"variable",
|
||||
"home",
|
||||
"tmpdir",
|
||||
"path",
|
||||
"prompt",
|
||||
"ps1"
|
||||
],
|
||||
"license": "ISC",
|
||||
"main": "osenv.js",
|
||||
"name": "osenv",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/npm/osenv.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "tap test/*.js"
|
||||
},
|
||||
"version": "0.1.4"
|
||||
}
|
||||
71
node_modules/osenv/test/unix.js
generated
vendored
Normal file
71
node_modules/osenv/test/unix.js
generated
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
// only run this test on windows
|
||||
// pretending to be another platform is too hacky, since it breaks
|
||||
// how the underlying system looks up module paths and runs
|
||||
// child processes, and all that stuff is cached.
|
||||
var tap = require('tap')
|
||||
|
||||
|
||||
if (process.platform === 'win32') {
|
||||
tap.plan(0, 'Skip unix tests, this is not unix')
|
||||
process.exit(0)
|
||||
}
|
||||
|
||||
// like unix, but funny
|
||||
process.env.USER = 'sirUser'
|
||||
process.env.HOME = '/home/sirUser'
|
||||
process.env.HOSTNAME = 'my-machine'
|
||||
process.env.TMPDIR = '/tmpdir'
|
||||
process.env.TMP = '/tmp'
|
||||
process.env.TEMP = '/temp'
|
||||
process.env.PATH = '/opt/local/bin:/usr/local/bin:/usr/bin/:bin'
|
||||
process.env.PS1 = '(o_o) $ '
|
||||
process.env.EDITOR = 'edit'
|
||||
process.env.VISUAL = 'visualedit'
|
||||
process.env.SHELL = 'zsh'
|
||||
|
||||
tap.test('basic unix sanity test', function (t) {
|
||||
var osenv = require('../osenv.js')
|
||||
|
||||
t.equal(osenv.user(), process.env.USER)
|
||||
t.equal(osenv.home(), process.env.HOME)
|
||||
t.equal(osenv.hostname(), process.env.HOSTNAME)
|
||||
t.same(osenv.path(), process.env.PATH.split(':'))
|
||||
t.equal(osenv.prompt(), process.env.PS1)
|
||||
t.equal(osenv.tmpdir(), process.env.TMPDIR)
|
||||
|
||||
// mildly evil, but it's for a test.
|
||||
process.env.TMPDIR = ''
|
||||
delete require.cache[require.resolve('../osenv.js')]
|
||||
var osenv = require('../osenv.js')
|
||||
t.equal(osenv.tmpdir(), process.env.TMP)
|
||||
|
||||
process.env.TMP = ''
|
||||
delete require.cache[require.resolve('../osenv.js')]
|
||||
var osenv = require('../osenv.js')
|
||||
t.equal(osenv.tmpdir(), process.env.TEMP)
|
||||
|
||||
process.env.TEMP = ''
|
||||
delete require.cache[require.resolve('../osenv.js')]
|
||||
var osenv = require('../osenv.js')
|
||||
osenv.home = function () { return null }
|
||||
t.equal(osenv.tmpdir(), '/tmp')
|
||||
|
||||
t.equal(osenv.editor(), 'edit')
|
||||
process.env.EDITOR = ''
|
||||
delete require.cache[require.resolve('../osenv.js')]
|
||||
var osenv = require('../osenv.js')
|
||||
t.equal(osenv.editor(), 'visualedit')
|
||||
|
||||
process.env.VISUAL = ''
|
||||
delete require.cache[require.resolve('../osenv.js')]
|
||||
var osenv = require('../osenv.js')
|
||||
t.equal(osenv.editor(), 'vi')
|
||||
|
||||
t.equal(osenv.shell(), 'zsh')
|
||||
process.env.SHELL = ''
|
||||
delete require.cache[require.resolve('../osenv.js')]
|
||||
var osenv = require('../osenv.js')
|
||||
t.equal(osenv.shell(), 'bash')
|
||||
|
||||
t.end()
|
||||
})
|
||||
74
node_modules/osenv/test/windows.js
generated
vendored
Normal file
74
node_modules/osenv/test/windows.js
generated
vendored
Normal file
@@ -0,0 +1,74 @@
|
||||
// only run this test on windows
|
||||
// pretending to be another platform is too hacky, since it breaks
|
||||
// how the underlying system looks up module paths and runs
|
||||
// child processes, and all that stuff is cached.
|
||||
if (process.platform !== 'win32') {
|
||||
console.log('TAP version 13\n' +
|
||||
'1..0 # Skip windows tests, this is not windows\n')
|
||||
return
|
||||
}
|
||||
|
||||
// load this before clubbing the platform name.
|
||||
var tap = require('tap')
|
||||
|
||||
process.env.windir = 'c:\\windows'
|
||||
process.env.USERDOMAIN = 'some-domain'
|
||||
process.env.USERNAME = 'sirUser'
|
||||
process.env.USERPROFILE = 'C:\\Users\\sirUser'
|
||||
process.env.COMPUTERNAME = 'my-machine'
|
||||
process.env.TMPDIR = 'C:\\tmpdir'
|
||||
process.env.TMP = 'C:\\tmp'
|
||||
process.env.TEMP = 'C:\\temp'
|
||||
process.env.Path = 'C:\\Program Files\\;C:\\Binary Stuff\\bin'
|
||||
process.env.PROMPT = '(o_o) $ '
|
||||
process.env.EDITOR = 'edit'
|
||||
process.env.VISUAL = 'visualedit'
|
||||
process.env.ComSpec = 'some-com'
|
||||
|
||||
tap.test('basic windows sanity test', function (t) {
|
||||
var osenv = require('../osenv.js')
|
||||
|
||||
t.equal(osenv.user(),
|
||||
process.env.USERDOMAIN + '\\' + process.env.USERNAME)
|
||||
t.equal(osenv.home(), process.env.USERPROFILE)
|
||||
t.equal(osenv.hostname(), process.env.COMPUTERNAME)
|
||||
t.same(osenv.path(), process.env.Path.split(';'))
|
||||
t.equal(osenv.prompt(), process.env.PROMPT)
|
||||
t.equal(osenv.tmpdir(), process.env.TMPDIR)
|
||||
|
||||
// mildly evil, but it's for a test.
|
||||
process.env.TMPDIR = ''
|
||||
delete require.cache[require.resolve('../osenv.js')]
|
||||
var osenv = require('../osenv.js')
|
||||
t.equal(osenv.tmpdir(), process.env.TMP)
|
||||
|
||||
process.env.TMP = ''
|
||||
delete require.cache[require.resolve('../osenv.js')]
|
||||
var osenv = require('../osenv.js')
|
||||
t.equal(osenv.tmpdir(), process.env.TEMP)
|
||||
|
||||
process.env.TEMP = ''
|
||||
delete require.cache[require.resolve('../osenv.js')]
|
||||
var osenv = require('../osenv.js')
|
||||
osenv.home = function () { return null }
|
||||
t.equal(osenv.tmpdir(), 'c:\\windows\\temp')
|
||||
|
||||
t.equal(osenv.editor(), 'edit')
|
||||
process.env.EDITOR = ''
|
||||
delete require.cache[require.resolve('../osenv.js')]
|
||||
var osenv = require('../osenv.js')
|
||||
t.equal(osenv.editor(), 'visualedit')
|
||||
|
||||
process.env.VISUAL = ''
|
||||
delete require.cache[require.resolve('../osenv.js')]
|
||||
var osenv = require('../osenv.js')
|
||||
t.equal(osenv.editor(), 'notepad.exe')
|
||||
|
||||
t.equal(osenv.shell(), 'some-com')
|
||||
process.env.ComSpec = ''
|
||||
delete require.cache[require.resolve('../osenv.js')]
|
||||
var osenv = require('../osenv.js')
|
||||
t.equal(osenv.shell(), 'cmd')
|
||||
|
||||
t.end()
|
||||
})
|
||||
39
node_modules/osenv/x.tap
generated
vendored
Normal file
39
node_modules/osenv/x.tap
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
TAP version 13
|
||||
# Subtest: test/unix.js
|
||||
TAP version 13
|
||||
# Subtest: basic unix sanity test
|
||||
ok 1 - should be equal
|
||||
ok 2 - should be equal
|
||||
ok 3 - should be equal
|
||||
ok 4 - should be equivalent
|
||||
ok 5 - should be equal
|
||||
ok 6 - should be equal
|
||||
ok 7 - should be equal
|
||||
ok 8 - should be equal
|
||||
ok 9 - should be equal
|
||||
ok 10 - should be equal
|
||||
ok 11 - should be equal
|
||||
ok 12 - should be equal
|
||||
ok 13 - should be equal
|
||||
ok 14 - should be equal
|
||||
1..14
|
||||
ok 1 - basic unix sanity test # time=10.712ms
|
||||
|
||||
1..1
|
||||
# time=18.422ms
|
||||
ok 1 - test/unix.js # time=169.827ms
|
||||
|
||||
# Subtest: test/windows.js
|
||||
TAP version 13
|
||||
1..0 # Skip windows tests, this is not windows
|
||||
|
||||
ok 2 - test/windows.js # SKIP Skip windows tests, this is not windows
|
||||
|
||||
# Subtest: test/nada.js
|
||||
TAP version 13
|
||||
1..0
|
||||
|
||||
ok 2 - test/nada.js
|
||||
|
||||
1..3
|
||||
# time=274.247ms
|
||||
Reference in New Issue
Block a user