@socketsecurity/cli 0.5.2 → 0.5.4
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/lib/shadow/link.cjs +9 -2
- package/package.json +1 -2
package/lib/shadow/link.cjs
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
/* eslint-disable no-console */
|
|
2
|
-
const {
|
|
2
|
+
const { realpathSync } = require('fs')
|
|
3
3
|
const path = require('path')
|
|
4
4
|
|
|
5
5
|
const which = require('which')
|
|
6
6
|
|
|
7
|
+
if (process.platform === 'win32') {
|
|
8
|
+
console.error('Socket npm and socket npx wrapper Windows suppport is limited to WSL at this time.')
|
|
9
|
+
process.exit(1)
|
|
10
|
+
}
|
|
11
|
+
|
|
7
12
|
/**
|
|
8
13
|
* @param {string} realDirname path to shadow/bin
|
|
9
14
|
* @param {'npm' | 'npx'} binname
|
|
@@ -23,12 +28,14 @@ function installLinks (realDirname, binname) {
|
|
|
23
28
|
}
|
|
24
29
|
return !isShadow
|
|
25
30
|
})
|
|
31
|
+
if (npmpath && process.platform === 'win32') {
|
|
32
|
+
return npmpath
|
|
33
|
+
}
|
|
26
34
|
if (!npmpath) {
|
|
27
35
|
console.error('Socket unable to locate npm ensure it is available in the PATH environment variable')
|
|
28
36
|
process.exit(127)
|
|
29
37
|
}
|
|
30
38
|
if (shadowIndex === -1) {
|
|
31
|
-
chmodSync(realNpmShadowBinDir, parseInt('755', 8))
|
|
32
39
|
const bindir = path.join(realDirname)
|
|
33
40
|
process.env['PATH'] = `${
|
|
34
41
|
bindir
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@socketsecurity/cli",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.4",
|
|
4
4
|
"description": "CLI tool for Socket.dev",
|
|
5
5
|
"homepage": "http://github.com/SocketDev/socket-cli-js",
|
|
6
6
|
"repository": {
|
|
@@ -31,7 +31,6 @@
|
|
|
31
31
|
"lib/shadow/**"
|
|
32
32
|
],
|
|
33
33
|
"scripts": {
|
|
34
|
-
"echo": "echo $PATH",
|
|
35
34
|
"check:dependency-check": "dependency-check '*.js' 'lib/shadow/*.cjs' '*.mjs' 'test/**/*.js' --no-dev",
|
|
36
35
|
"check:installed-check": "installed-check -i eslint-plugin-jsdoc",
|
|
37
36
|
"check:lint": "eslint --report-unused-disable-directives .",
|