New upstream version 0.1.4

parent e7655d8a
language: node_js
language: node_js
node_js:
- '0.8'
- '0.10'
- '0.12'
- 'iojs'
before_install:
- npm install -g npm@latest
Copyright (c) Isaac Z. Schlueter ("Author")
All rights reserved.
The ISC License
The BSD License
Copyright (c) Isaac Z. Schlueter and Contributors
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
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.
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
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.
var isWindows = process.platform === 'win32'
var path = require('path')
var exec = require('child_process').exec
var os = require('os')
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
......@@ -46,13 +47,11 @@ memo('hostname', function () {
}, 'hostname')
memo('tmpdir', function () {
return os.tmpDir()
return osTmpdir()
})
memo('home', function () {
return ( isWindows ? process.env.USERPROFILE
: process.env.HOME
)
return osHomedir()
})
memo('path', function () {
......
{
"name": "osenv",
"version": "0.1.0",
"version": "0.1.4",
"main": "osenv.js",
"directories": {
"test": "test"
},
"dependencies": {},
"dependencies": {
"os-homedir": "^1.0.0",
"os-tmpdir": "^1.0.0"
},
"devDependencies": {
"tap": "~0.4.9"
"tap": "^8.0.1"
},
"scripts": {
"test": "tap test/*.js"
},
"repository": {
"type": "git",
"url": "git://github.com/isaacs/osenv"
},
"repository": "https://github.com/npm/osenv",
"keywords": [
"environment",
"variable",
......@@ -26,6 +26,6 @@
"ps1"
],
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
"license": "BSD",
"license": "ISC",
"description": "Look up environment settings specific to different operating systems"
}
......@@ -2,13 +2,13 @@
// 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') {
console.log('TAP Version 13\n' +
'1..0\n' +
'# Skip unix tests, this is not unix\n')
return
tap.plan(0, 'Skip unix tests, this is not unix')
process.exit(0)
}
var tap = require('tap')
// like unix, but funny
process.env.USER = 'sirUser'
......
......@@ -3,9 +3,8 @@
// 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\n' +
'# Skip windows tests, this is not windows\n')
console.log('TAP version 13\n' +
'1..0 # Skip windows tests, this is not windows\n')
return
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment