nori-ai-cli 0.0.1 → 0.0.2
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/bin/nori.js +6 -6
- package/package.json +1 -1
package/bin/nori.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// Unified entry point for the
|
|
2
|
+
// Unified entry point for the Nori CLI.
|
|
3
3
|
|
|
4
4
|
import { spawn } from "node:child_process";
|
|
5
5
|
import { existsSync } from "fs";
|
|
@@ -61,8 +61,8 @@ if (!targetTriple) {
|
|
|
61
61
|
|
|
62
62
|
const vendorRoot = path.join(__dirname, "..", "vendor");
|
|
63
63
|
const archRoot = path.join(vendorRoot, targetTriple);
|
|
64
|
-
const
|
|
65
|
-
const binaryPath = path.join(archRoot, "
|
|
64
|
+
const noriBinaryName = process.platform === "win32" ? "nori.exe" : "nori";
|
|
65
|
+
const binaryPath = path.join(archRoot, "nori", noriBinaryName);
|
|
66
66
|
|
|
67
67
|
// Use an asynchronous spawn instead of spawnSync so that Node is able to
|
|
68
68
|
// respond to signals (e.g. Ctrl-C / SIGINT) while the native binary is
|
|
@@ -81,7 +81,7 @@ function getUpdatedPath(newDirs) {
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
/**
|
|
84
|
-
* Use heuristics to detect the package manager that was used to install
|
|
84
|
+
* Use heuristics to detect the package manager that was used to install Nori
|
|
85
85
|
* in order to give the user a hint about how to update it.
|
|
86
86
|
*/
|
|
87
87
|
function detectPackageManager() {
|
|
@@ -116,8 +116,8 @@ const updatedPath = getUpdatedPath(additionalDirs);
|
|
|
116
116
|
const env = { ...process.env, PATH: updatedPath };
|
|
117
117
|
const packageManagerEnvVar =
|
|
118
118
|
detectPackageManager() === "bun"
|
|
119
|
-
? "
|
|
120
|
-
: "
|
|
119
|
+
? "NORI_MANAGED_BY_BUN"
|
|
120
|
+
: "NORI_MANAGED_BY_NPM";
|
|
121
121
|
env[packageManagerEnvVar] = "1";
|
|
122
122
|
|
|
123
123
|
const child = spawn(binaryPath, process.argv.slice(2), {
|