libnpmexec 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -2
- package/README.md +1 -1
- package/lib/index.js +2 -2
- package/lib/run-script.js +3 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## v1.0.0
|
|
4
4
|
|
|
5
|
-
- Initial
|
|
5
|
+
- Initial implementation, moves the code that used to live in the **npm cli**,
|
|
6
|
+
ref: https://github.com/npm/cli/blob/release/v7.10.0/lib/exec.js into this
|
|
7
|
+
separate module, providing a programmatic API to the **npm exec** functionality.
|
|
6
8
|
|
package/README.md
CHANGED
|
@@ -39,7 +39,7 @@ await libexec({
|
|
|
39
39
|
- `packages`: A list of packages to be used (possibly fetch from the registry) **Array<String>**, defaults to `[]`
|
|
40
40
|
- `path`: Location to where to read local project info (`package.json`) **String**, defaults to `.`
|
|
41
41
|
- `runPath`: Location to where to execute the script **String**, defaults to `.`
|
|
42
|
-
- `
|
|
42
|
+
- `scriptShell`: Default shell to be used **String**
|
|
43
43
|
- `yes`: Should skip download confirmation prompt when fetching missing packages from the registry? **Boolean**
|
|
44
44
|
- `registry`, `cache`, and more options that are forwarded to [@npmcli/arborist](https://github.com/npm/arborist/) and [pacote](https://github.com/npm/pacote/#options) **Object**
|
|
45
45
|
|
package/lib/index.js
CHANGED
|
@@ -38,7 +38,7 @@ const exec = async (opts) => {
|
|
|
38
38
|
packages: _packages = [],
|
|
39
39
|
path = '.',
|
|
40
40
|
runPath = '.',
|
|
41
|
-
|
|
41
|
+
scriptShell = undefined,
|
|
42
42
|
yes = undefined,
|
|
43
43
|
...flatOptions
|
|
44
44
|
} = opts
|
|
@@ -58,7 +58,7 @@ const exec = async (opts) => {
|
|
|
58
58
|
path,
|
|
59
59
|
pathArr,
|
|
60
60
|
runPath,
|
|
61
|
-
|
|
61
|
+
scriptShell,
|
|
62
62
|
})
|
|
63
63
|
|
|
64
64
|
// nothing to maybe install, skip the arborist dance
|
package/lib/run-script.js
CHANGED
|
@@ -23,10 +23,10 @@ const run = async ({
|
|
|
23
23
|
path,
|
|
24
24
|
pathArr,
|
|
25
25
|
runPath,
|
|
26
|
-
|
|
26
|
+
scriptShell,
|
|
27
27
|
}) => {
|
|
28
28
|
// turn list of args into command string
|
|
29
|
-
const script = call || args.shift() ||
|
|
29
|
+
const script = call || args.shift() || scriptShell
|
|
30
30
|
const colorize = color ? chalk : nocolor
|
|
31
31
|
|
|
32
32
|
// do the fakey runScript dance
|
|
@@ -45,7 +45,7 @@ const run = async ({
|
|
|
45
45
|
log.disableProgress()
|
|
46
46
|
|
|
47
47
|
try {
|
|
48
|
-
if (script ===
|
|
48
|
+
if (script === scriptShell) {
|
|
49
49
|
const isTTY = !noTTY()
|
|
50
50
|
|
|
51
51
|
if (isTTY) {
|