@microsoft/inshellisense 0.0.1-rc.24 → 0.0.1-rc.25

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/bin.js +32 -0
  2. package/package.json +13 -8
package/bin.js ADDED
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/env node
2
+ // Copyright (c) Microsoft Corporation.
3
+ // Licensed under the MIT License.
4
+
5
+ const { spawnSync } = require("child_process");
6
+ const path = require("path");
7
+
8
+ const platform = process.platform;
9
+ const arch = process.arch;
10
+
11
+ const platformArch = `${platform}-${arch}`;
12
+ const packageName = `@microsoft/inshellisense-${platformArch}`;
13
+ const binaryName = platform === "win32"
14
+ ? `inshellisense-${platformArch}.exe`
15
+ : `inshellisense-${platformArch}`;
16
+
17
+ try {
18
+ const platformPkgPath = require.resolve(`${packageName}/package.json`);
19
+ const platformPkgDir = path.dirname(platformPkgPath);
20
+ const binaryPath = path.join(platformPkgDir, binaryName);
21
+
22
+ const result = spawnSync(binaryPath, process.argv.slice(2), {
23
+ stdio: "inherit",
24
+ shell: false,
25
+ });
26
+
27
+ process.exit(result.status ?? 1);
28
+ } catch (err) {
29
+ console.error(`inshellisense: Platform ${platformArch} is not supported.`);
30
+ console.error(err.message);
31
+ process.exit(1);
32
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/inshellisense",
3
- "version": "0.0.1-rc.24",
3
+ "version": "0.0.1-rc.25",
4
4
  "description": "IDE style command line auto complete",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -13,16 +13,21 @@
13
13
  "bugs": {
14
14
  "url": "https://github.com/microsoft/inshellisense/issues"
15
15
  },
16
+ "bin": {
17
+ "is": "bin.js",
18
+ "inshellisense": "bin.js"
19
+ },
16
20
  "files": [
17
21
  "*.md",
18
- "LICENSE"
22
+ "LICENSE",
23
+ "bin.js"
19
24
  ],
20
25
  "optionalDependencies": {
21
- "@microsoft/inshellisense-darwin-x64": "0.0.1-rc.24",
22
- "@microsoft/inshellisense-darwin-arm64": "0.0.1-rc.24",
23
- "@microsoft/inshellisense-linux-x64": "0.0.1-rc.24",
24
- "@microsoft/inshellisense-linux-arm64": "0.0.1-rc.24",
25
- "@microsoft/inshellisense-win32-x64": "0.0.1-rc.24",
26
- "@microsoft/inshellisense-win32-arm64": "0.0.1-rc.24"
26
+ "@microsoft/inshellisense-darwin-x64": "0.0.1-rc.25",
27
+ "@microsoft/inshellisense-darwin-arm64": "0.0.1-rc.25",
28
+ "@microsoft/inshellisense-linux-x64": "0.0.1-rc.25",
29
+ "@microsoft/inshellisense-linux-arm64": "0.0.1-rc.25",
30
+ "@microsoft/inshellisense-win32-x64": "0.0.1-rc.25",
31
+ "@microsoft/inshellisense-win32-arm64": "0.0.1-rc.25"
27
32
  }
28
33
  }