@zkochan/cmd-shim
Advanced tools
Comparing version 5.1.0 to 5.1.1
41
index.js
@@ -226,3 +226,12 @@ 'use strict'; | ||
// ) | ||
let cmd = nodePath ? `@SET NODE_PATH=${nodePath}\r\n` : ''; | ||
let cmd = '@SETLOCAL\r\n'; | ||
if (nodePath) { | ||
cmd += `\ | ||
@IF NOT DEFINED NODE_PATH (\r | ||
@SET NODE_PATH=${nodePath}\r | ||
) ELSE (\r | ||
@SET NODE_PATH=%NODE_PATH%;${nodePath}\r | ||
)\r | ||
`; | ||
} | ||
if (longProg) { | ||
@@ -233,3 +242,2 @@ cmd += `\ | ||
) ELSE (\r | ||
@SETLOCAL\r | ||
@SET PATHEXT=%PATHEXT:;.JS;=;%\r | ||
@@ -295,6 +303,13 @@ ${prog} ${args} ${target} ${progArgs}%*\r | ||
`; | ||
const env = opts.nodePath ? `export NODE_PATH="${shNodePath}"\n` : ''; | ||
if (opts.nodePath) { | ||
sh += `\ | ||
if [ -z "$NODE_PATH" ]; then | ||
export NODE_PATH="${shNodePath}" | ||
else | ||
export NODE_PATH="$NODE_PATH:${shNodePath}" | ||
fi | ||
`; | ||
} | ||
if (shLongProg) { | ||
sh += `\ | ||
${env}\ | ||
if [ -x ${shLongProg} ]; then | ||
@@ -309,3 +324,2 @@ exec ${shLongProg} ${args} ${shTarget} ${progArgs}"$@" | ||
sh += `\ | ||
${env}\ | ||
${shProg} ${args} ${shTarget} ${progArgs}"$@" | ||
@@ -380,4 +394,6 @@ exit $? | ||
$exe="" | ||
${opts.nodePath ? `$env_node_path=$env:NODE_PATH | ||
$env:NODE_PATH="${nodePath}" | ||
${opts.nodePath ? `\ | ||
$pathsep=":" | ||
$env_node_path=$env:NODE_PATH | ||
$new_node_path="${nodePath}" | ||
` : ''}\ | ||
@@ -388,2 +404,3 @@ if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { | ||
$exe=".exe" | ||
${opts.nodePath ? ' $pathsep=";"\n' : ''}\ | ||
}`; | ||
@@ -393,4 +410,10 @@ if (opts.nodePath) { | ||
else { | ||
$env:NODE_PATH="${shNodePath}" | ||
}`; | ||
$new_node_path="${shNodePath}" | ||
} | ||
if ([string]::IsNullOrEmpty($env_node_path)) { | ||
$env:NODE_PATH=$new_node_path | ||
} else { | ||
$env:NODE_PATH="$env_node_path$pathsep$new_node_path" | ||
} | ||
`; | ||
} | ||
@@ -397,0 +420,0 @@ if (pwshLongProg) { |
117
package.json
{ | ||
"name": "@zkochan/cmd-shim", | ||
"version": "5.1.0", | ||
"description": "Used in pnpm for command line application support", | ||
"author": { | ||
"name": "Zoltan Kochan", | ||
"email": "zoltan.kochan@gmail.com", | ||
"url": "http://kochan.io" | ||
}, | ||
"scripts": { | ||
"clean": "tsc --build --clean", | ||
"build": "tsc --build --verbose --listEmittedFiles", | ||
"pretest:unit": "tsc --build test --verbose --listEmittedFiles", | ||
"test:unit": "jest", | ||
"test": "pnpm run build && standard && pnpm run test:unit && mos test", | ||
"md": "mos", | ||
"prepublishOnly": "pnpm run build" | ||
}, | ||
"files": [ | ||
"index.d.ts", | ||
"index.d.ts.map", | ||
"index.js", | ||
"index.js.map" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/pnpm/cmd-shim.git" | ||
}, | ||
"license": "BSD-2-Clause", | ||
"dependencies": { | ||
"is-windows": "^1.0.2" | ||
}, | ||
"devDependencies": { | ||
"@types/is-windows": "^1.0.0", | ||
"@types/jest": "^26.0.20", | ||
"@types/node": "^14.14.20", | ||
"jest": "^26.6.3", | ||
"memfs": "^3.2.0", | ||
"mock-fs": "^4.13.0", | ||
"mos": "^1.3.1", | ||
"mos-plugin-readme": "^1.0.4", | ||
"standard": "^14.3.4", | ||
"typescript": "^4.1.3" | ||
}, | ||
"engines": { | ||
"node": ">=10.13" | ||
}, | ||
"mos": { | ||
"plugins": [ | ||
"readme" | ||
] | ||
}, | ||
"standard": { | ||
"env": { | ||
"jest": true | ||
} | ||
}, | ||
"jest": { | ||
"testEnvironment": "node" | ||
} | ||
"name": "@zkochan/cmd-shim", | ||
"version": "5.1.1", | ||
"description": "Used in pnpm for command line application support", | ||
"author": { | ||
"name": "Zoltan Kochan", | ||
"email": "zoltan.kochan@gmail.com", | ||
"url": "http://kochan.io" | ||
}, | ||
"files": [ | ||
"index.d.ts", | ||
"index.d.ts.map", | ||
"index.js", | ||
"index.js.map" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/pnpm/cmd-shim.git" | ||
}, | ||
"license": "BSD-2-Clause", | ||
"dependencies": { | ||
"is-windows": "^1.0.2" | ||
}, | ||
"devDependencies": { | ||
"@types/is-windows": "^1.0.0", | ||
"@types/jest": "^26.0.20", | ||
"@types/node": "^14.14.20", | ||
"jest": "^26.6.3", | ||
"memfs": "^3.2.0", | ||
"mock-fs": "^4.13.0", | ||
"mos": "^1.3.1", | ||
"mos-plugin-readme": "^1.0.4", | ||
"standard": "^14.3.4", | ||
"typescript": "^4.1.3" | ||
}, | ||
"engines": { | ||
"node": ">=10.13" | ||
}, | ||
"mos": { | ||
"plugins": [ | ||
"readme" | ||
] | ||
}, | ||
"standard": { | ||
"env": { | ||
"jest": true | ||
} | ||
}, | ||
"jest": { | ||
"testEnvironment": "node" | ||
}, | ||
"scripts": { | ||
"clean": "tsc --build --clean", | ||
"build": "tsc --build --verbose --listEmittedFiles", | ||
"pretest:unit": "tsc --build test --verbose --listEmittedFiles", | ||
"test:unit": "jest", | ||
"test": "pnpm run build && standard && pnpm run test:unit && mos test", | ||
"md": "mos" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
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
33102
545