diff options
author | Rebecca Turner <me@re-becca.org> | 2015-07-01 12:09:12 +0300 |
---|---|---|
committer | Rebecca Turner <me@re-becca.org> | 2015-07-01 12:09:12 +0300 |
commit | 2a14fe0381431de42c1c0bc8fbbe5fdc739c45cf (patch) | |
tree | ecbd18409fcf9dba45e44fd47c1dd6bc35d64664 | |
parent | 39789694dca4b37df42cfb78da36534793b7f546 (diff) |
osenv@0.1.3
-rw-r--r-- | node_modules/os-homedir/index.js | 24 | ||||
-rw-r--r-- | node_modules/os-homedir/license | 21 | ||||
-rw-r--r-- | node_modules/os-homedir/package.json | 94 | ||||
-rw-r--r-- | node_modules/os-homedir/readme.md | 33 | ||||
-rw-r--r-- | node_modules/osenv/osenv.js | 5 | ||||
-rw-r--r-- | node_modules/osenv/package.json | 20 | ||||
-rw-r--r-- | node_modules/osenv/x.tap | 39 | ||||
-rw-r--r-- | package.json | 2 |
8 files changed, 225 insertions, 13 deletions
diff --git a/node_modules/os-homedir/index.js b/node_modules/os-homedir/index.js new file mode 100644 index 000000000..758ff653d --- /dev/null +++ b/node_modules/os-homedir/index.js @@ -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 || (user ? (process.getuid() === 0 ? '/root' : '/home/' + user) : null); + } + + return home || null; +} + +module.exports = typeof os.homedir === 'function' ? os.homedir : homedir; diff --git a/node_modules/os-homedir/license b/node_modules/os-homedir/license new file mode 100644 index 000000000..654d0bfe9 --- /dev/null +++ b/node_modules/os-homedir/license @@ -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. diff --git a/node_modules/os-homedir/package.json b/node_modules/os-homedir/package.json new file mode 100644 index 000000000..04cd75499 --- /dev/null +++ b/node_modules/os-homedir/package.json @@ -0,0 +1,94 @@ +{ + "_args": [ + [ + "os-homedir@^1.0.0", + "/Users/rebecca/code/npm/node_modules/osenv" + ] + ], + "_from": "os-homedir@>=1.0.0 <2.0.0", + "_id": "os-homedir@1.0.0", + "_inCache": true, + "_location": "/os-homedir", + "_nodeVersion": "2.3.0", + "_npmUser": { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" + }, + "_npmVersion": "2.11.1", + "_phantomChildren": {}, + "_requested": { + "name": "os-homedir", + "raw": "os-homedir@^1.0.0", + "rawSpec": "^1.0.0", + "scope": null, + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/osenv" + ], + "_resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.0.tgz", + "_shasum": "e37078bc61b5869063053897257e39ec1261b702", + "_shrinkwrap": null, + "_spec": "os-homedir@^1.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/osenv", + "author": { + "email": "sindresorhus@gmail.com", + "name": "Sindre Sorhus", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/os-homedir/issues" + }, + "dependencies": {}, + "description": "io.js 2.3.0 os.homedir() ponyfill", + "devDependencies": { + "ava": "0.0.4", + "path-exists": "^1.0.0" + }, + "directories": {}, + "dist": { + "shasum": "e37078bc61b5869063053897257e39ec1261b702", + "tarball": "http://registry.npmjs.org/os-homedir/-/os-homedir-1.0.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "7e39e2e049de404f06233fa617ecf46fed997a78", + "homepage": "https://github.com/sindresorhus/os-homedir", + "keywords": [ + "built-in", + "core", + "dir", + "directory", + "folder", + "home", + "homedir", + "os", + "path", + "polyfill", + "ponyfill", + "shim", + "user" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "os-homedir", + "optionalDependencies": {}, + "repository": { + "type": "git", + "url": "https://github.com/sindresorhus/os-homedir" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.0.0" +} diff --git a/node_modules/os-homedir/readme.md b/node_modules/os-homedir/readme.md new file mode 100644 index 000000000..4851f104e --- /dev/null +++ b/node_modules/os-homedir/readme.md @@ -0,0 +1,33 @@ +# os-homedir [![Build Status](https://travis-ci.org/sindresorhus/os-homedir.svg?branch=master)](https://travis-ci.org/sindresorhus/os-homedir) + +> io.js 2.3.0 [`os.homedir()`](https://iojs.org/api/os.html#os_os_homedir) ponyfill + +> Ponyfill: A polyfill that doesn't overwrite the native method + + +## Install + +``` +$ npm install --save os-homedir +``` + + +## Usage + +```js +var 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](http://sindresorhus.com) diff --git a/node_modules/osenv/osenv.js b/node_modules/osenv/osenv.js index 0cabcba66..702a95b98 100644 --- a/node_modules/osenv/osenv.js +++ b/node_modules/osenv/osenv.js @@ -2,6 +2,7 @@ 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 @@ -50,9 +51,7 @@ memo('tmpdir', function () { }) memo('home', function () { - return ( isWindows ? process.env.USERPROFILE - : process.env.HOME - ) + return osHomedir() }) memo('path', function () { diff --git a/node_modules/osenv/package.json b/node_modules/osenv/package.json index 6a916b508..98144d441 100644 --- a/node_modules/osenv/package.json +++ b/node_modules/osenv/package.json @@ -6,15 +6,15 @@ ] ], "_from": "osenv@>=0.1.2 <0.2.0", - "_id": "osenv@0.1.2", + "_id": "osenv@0.1.3", "_inCache": true, "_location": "/osenv", "_nodeVersion": "2.2.1", "_npmUser": { - "email": "me@re-becca.org", - "name": "iarna" + "email": "isaacs@npmjs.com", + "name": "isaacs" }, - "_npmVersion": "3.0.0-pre.11", + "_npmVersion": "3.0.0", "_phantomChildren": {}, "_requested": { "name": "osenv", @@ -28,7 +28,8 @@ "/", "/node-gyp" ], - "_shasum": "f4d23ebeceaef078600fb78c0ea58fac5996a02d", + "_resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.3.tgz", + "_shasum": "83cf05c6d6458fc4d5ac6362ea325d92f2754217", "_shrinkwrap": null, "_spec": "osenv@~0.1.2", "_where": "/Users/rebecca/code/npm", @@ -41,6 +42,7 @@ "url": "https://github.com/npm/osenv/issues" }, "dependencies": { + "os-homedir": "^1.0.0", "os-tmpdir": "^1.0.0" }, "description": "Look up environment settings specific to different operating systems", @@ -51,10 +53,10 @@ "test": "test" }, "dist": { - "shasum": "f4d23ebeceaef078600fb78c0ea58fac5996a02d", - "tarball": "http://registry.npmjs.org/osenv/-/osenv-0.1.2.tgz" + "shasum": "83cf05c6d6458fc4d5ac6362ea325d92f2754217", + "tarball": "http://registry.npmjs.org/osenv/-/osenv-0.1.3.tgz" }, - "gitHead": "88a154d6d8ad39fefb9af2fe1b306cd12fb6d6d0", + "gitHead": "f746b3405d8f9e28054d11b97e1436f6a15016c4", "homepage": "https://github.com/npm/osenv#readme", "keywords": [ "environment", @@ -94,5 +96,5 @@ "scripts": { "test": "tap test/*.js" }, - "version": "0.1.2" + "version": "0.1.3" } diff --git a/node_modules/osenv/x.tap b/node_modules/osenv/x.tap new file mode 100644 index 000000000..90d847208 --- /dev/null +++ b/node_modules/osenv/x.tap @@ -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 diff --git a/package.json b/package.json index adac83f0d..5236cbcf1 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,7 @@ "npmlog": "~1.2.1", "once": "~1.3.2", "opener": "~1.4.1", - "osenv": "~0.1.2", + "osenv": "~0.1.3", "path-is-inside": "~1.0.0", "read": "~1.0.6", "read-installed": "~4.0.1", |