Skip to content

Commit b686571

Browse files
committed
fix: path resolution for native modules
Signed-off-by: Chapman Pendery <cpendery@vt.edu>
1 parent 7d575cd commit b686571

File tree

4 files changed

+26
-20
lines changed

4 files changed

+26
-20
lines changed

package-lock.json

Lines changed: 16 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@microsoft/inshellisense",
3-
"version": "0.0.1-rc.27",
3+
"version": "0.0.1-rc.28",
44
"description": "IDE style command line auto complete",
55
"type": "module",
66
"engines": {
@@ -50,7 +50,7 @@
5050
"color-convert": "^2.0.1",
5151
"commander": "^11.0.0",
5252
"find-process": "^1.4.7",
53-
"node-pty": "1.2.0-beta.2",
53+
"node-pty": "1.2.0-beta.8",
5454
"strip-ansi": "^7.1.0",
5555
"toml": "^3.0.0",
5656
"uuid": "^11.1.0",

scripts/bin.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ const arch = process.arch;
1010

1111
const platformArch = `${platform}-${arch}`;
1212
const packageName = `@microsoft/inshellisense-${platformArch}`;
13-
const binaryName = platform === "win32"
14-
? `inshellisense-${platformArch}.exe`
15-
: `inshellisense-${platformArch}`;
13+
const binaryName = platform === "win32" ? `inshellisense-${platformArch}.exe` : `inshellisense-${platformArch}`;
1614

1715
try {
1816
const platformPkgPath = require.resolve(`${packageName}/package.json`);

scripts/pkg.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,13 @@ const applyBundlePatches = async (): Promise<void> => {
159159
"native locations",
160160
);
161161

162+
// Patch to handle absolute paths correctly (skip relative prefixes for absolute paths)
163+
patchBundle(
164+
'var dir = r + "/" + d;',
165+
'var dir = path_1.isAbsolute(d) ? d : r + "/" + d;',
166+
"absolute path handling",
167+
);
168+
162169
// Patch worker inline
163170
const workerCode = await bundleNodePtyWorker();
164171
patchBundle(

0 commit comments

Comments
 (0)