libnpmexec 1.1.1 → 1.2.0

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 ADDED
@@ -0,0 +1,17 @@
1
+ # Changelog
2
+
3
+ ## v1.1.0
4
+
5
+ - Add add walk up dir lookup logic to satisfy local bins,
6
+ similar to `@npmcli/run-script`
7
+
8
+ ## v1.0.1
9
+
10
+ - Fix `scriptShell` option name.
11
+
12
+ ## v1.0.0
13
+
14
+ - Initial implementation, moves the code that used to live in the **npm cli**,
15
+ ref: https://github.com/npm/cli/blob/release/v7.10.0/lib/exec.js into this
16
+ separate module, providing a programmatic API to the **npm exec** functionality.
17
+
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
- - `scriptShell`: Default shell to be used **String**
42
+ - `scriptShell`: Default shell to be used **String**, defaults to `sh` on POSIX systems, `process.env.ComSpec` OR `cmd` on Windows
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
@@ -16,6 +16,7 @@ const getBinFromManifest = require('./get-bin-from-manifest.js')
16
16
  const manifestMissing = require('./manifest-missing.js')
17
17
  const noTTY = require('./no-tty.js')
18
18
  const runScript = require('./run-script.js')
19
+ const isWindows = require('./is-windows.js')
19
20
 
20
21
  /* istanbul ignore next */
21
22
  const PATH = (
@@ -34,7 +35,7 @@ const exec = async (opts) => {
34
35
  packages: _packages = [],
35
36
  path = '.',
36
37
  runPath = '.',
37
- scriptShell = undefined,
38
+ scriptShell = isWindows ? process.env.ComSpec || 'cmd' : 'sh',
38
39
  yes = undefined,
39
40
  ...flatOptions
40
41
  } = opts
@@ -0,0 +1 @@
1
+ module.exports = process.platform === 'win32'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "libnpmexec",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "files": [
5
5
  "lib"
6
6
  ],