Comparing version 0.6.1 to 0.6.2
17
index.js
@@ -10,2 +10,3 @@ #!/usr/bin/env node | ||
var util = require('util'); | ||
var repl = require('repl'); | ||
@@ -55,2 +56,5 @@ var argv = require('minimist')(process.argv.slice(2)); | ||
// Newer versions of node use a symbol called util.inspect.custom. | ||
var inspectAttribute = util.inspect.custom || 'inspect'; | ||
function wrap(fun, key) { | ||
@@ -67,7 +71,12 @@ if (typeof fun !== 'function') { | ||
} | ||
var oldInspect = ret.inspect.bind(ret); | ||
var oldInspect; | ||
if (ret[inspectAttribute]) { | ||
oldInspect = ret[inspectAttribute].bind(ret); | ||
} else { | ||
oldInspect = function() { return ''; } | ||
} | ||
if (key === 'echo' || key === 'exec') { | ||
ret.inspect = emptyInspect; | ||
ret[inspectAttribute] = emptyInspect; | ||
} else if (key === 'pwd' || key === 'which') { | ||
ret.inspect = function () { | ||
ret[inspectAttribute] = function () { | ||
var oldResult = oldInspect(); | ||
@@ -80,3 +89,3 @@ return oldResult.match(/\n$/) ? oldResult : oldResult + '\n'; | ||
}; | ||
outerRet.inspect = outerRet.inspect || function () { return this(); }; | ||
outerRet[inspectAttribute] = outerRet[inspectAttribute] || function () { return this(); }; | ||
return outerRet; | ||
@@ -83,0 +92,0 @@ } |
{ | ||
"name": "n_shell", | ||
"version": "0.6.1", | ||
"version": "0.6.2", | ||
"description": "A node REPL with ShellJS loaded by default", | ||
@@ -11,2 +11,3 @@ "main": "index.js", | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"changelog": "shelljs-changelog", | ||
"release:major": "shelljs-release major", | ||
@@ -34,4 +35,4 @@ "release:minor": "shelljs-release minor", | ||
"shelljs": "^0.8.5", | ||
"shelljs-plugin-clear": "^0.2.0", | ||
"shelljs-plugin-inspect": "^0.2.0", | ||
"shelljs-plugin-clear": "^0.2.1", | ||
"shelljs-plugin-inspect": "^0.3.0", | ||
"shelljs-plugin-open": "^0.2.0", | ||
@@ -41,4 +42,5 @@ "shelljs-plugin-sleep": "^0.2.1" | ||
"devDependencies": { | ||
"shelljs-changelog": "^0.2.6", | ||
"shelljs-release": "^0.5.1" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11593
5
100
2
+ Addedshelljs-plugin-inspect@0.3.0(transitive)
- Removedshelljs-plugin-inspect@0.2.1(transitive)
Updatedshelljs-plugin-clear@^0.2.1