@vltpkg/cmd-shim 1.5.0 → 1.6.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.
Files changed (2) hide show
  1. package/dist/read.js +4 -3
  2. package/package.json +3 -3
package/dist/read.js CHANGED
@@ -13,16 +13,17 @@ const extractPath = (path, cmdshimContents) => {
13
13
  return extractPathFromCygwin(cmdshimContents);
14
14
  }
15
15
  };
16
+ // win32 cross-drive shims hold an absolute target, no basedir prefix
16
17
  const extractPathFromPowershell = (cmdshimContents) => {
17
- const matches = /"[$]basedir\/([^"]+?)"\s+[$]args/.exec(cmdshimContents);
18
+ const matches = /"(?:[$]basedir\/|(?=[a-zA-Z]:[\\/]))([^"]+?)"\s+[$]args/.exec(cmdshimContents);
18
19
  return matches?.[1]?.replace(/\\/g, '/');
19
20
  };
20
21
  const extractPathFromCmd = (cmdshimContents) => {
21
- const matches = /"%(?:~dp0|dp0%)\\([^"]+?)"\s+%[*]/.exec(cmdshimContents);
22
+ const matches = /"(?:%(?:~dp0|dp0%)\\|(?=[a-zA-Z]:[\\/]))([^"]+?)"\s+%[*]/.exec(cmdshimContents);
22
23
  return matches?.[1]?.replace(/\\/g, '/');
23
24
  };
24
25
  const extractPathFromCygwin = (cmdshimContents) => {
25
- const matches = /"[$]basedir\/([^"]+?)"\s+"[$]@"/.exec(cmdshimContents);
26
+ const matches = /"(?:[$]basedir\/|(?=[a-zA-Z]:[\\/]))([^"]+?)"\s+"[$]@"/.exec(cmdshimContents);
26
27
  return matches?.[1]?.replace(/\\/g, '/');
27
28
  };
28
29
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vltpkg/cmd-shim",
3
3
  "description": "Executable script shims for Windows",
4
- "version": "1.5.0",
4
+ "version": "1.6.1",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/vltpkg/vltpkg.git",
@@ -13,8 +13,8 @@
13
13
  "url": "http://vlt.sh"
14
14
  },
15
15
  "dependencies": {
16
- "@vltpkg/error-cause": "1.5.0",
17
- "@vltpkg/rollback-remove": "1.5.0"
16
+ "@vltpkg/error-cause": "1.6.1",
17
+ "@vltpkg/rollback-remove": "1.6.1"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@eslint/js": "^9.39.1",