@pylonsync/cli 0.7.0 → 0.8.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.
- package/bin/pylon.js +16 -3
- package/package.json +4 -3
package/bin/pylon.js
CHANGED
|
@@ -34,8 +34,13 @@ const require = createRequire(import.meta.url);
|
|
|
34
34
|
const PLATFORM_PACKAGES = {
|
|
35
35
|
"darwin-arm64": "@pylonsync/cli-darwin-arm64",
|
|
36
36
|
"linux-x64": "@pylonsync/cli-linux-x64",
|
|
37
|
+
"win32-x64": "@pylonsync/cli-win32-x64",
|
|
37
38
|
};
|
|
38
39
|
|
|
40
|
+
// Windows needs the suffix: the file on disk is pylon.exe, and spawnSync
|
|
41
|
+
// takes a path rather than doing a PATHEXT search.
|
|
42
|
+
const BINARY_NAME = process.platform === "win32" ? "pylon.exe" : "pylon";
|
|
43
|
+
|
|
39
44
|
const UNSUPPORTED_HINTS = {
|
|
40
45
|
"darwin-x64":
|
|
41
46
|
"Intel Macs aren't currently supported by the npm-distributed CLI " +
|
|
@@ -77,13 +82,21 @@ function resolveBinary() {
|
|
|
77
82
|
// PYLON_BIN=$HOME/.cargo/bin/pylon bun dev
|
|
78
83
|
const override = process.env.PYLON_BIN;
|
|
79
84
|
if (override) {
|
|
80
|
-
|
|
85
|
+
// A Windows override is easy to write without the suffix — cargo puts
|
|
86
|
+
// the binary at target\release\pylon.exe. Accept either spelling
|
|
87
|
+
// rather than reporting a missing file that is right there.
|
|
88
|
+
const candidates =
|
|
89
|
+
process.platform === "win32" && !override.toLowerCase().endsWith(".exe")
|
|
90
|
+
? [override, `${override}.exe`]
|
|
91
|
+
: [override];
|
|
92
|
+
const found = candidates.find((c) => existsSync(c));
|
|
93
|
+
if (!found) {
|
|
81
94
|
throw new Error(
|
|
82
95
|
`@pylonsync/cli: PYLON_BIN is set to "${override}" but no file ` +
|
|
83
96
|
`exists there.`,
|
|
84
97
|
);
|
|
85
98
|
}
|
|
86
|
-
return
|
|
99
|
+
return found;
|
|
87
100
|
}
|
|
88
101
|
|
|
89
102
|
const arch = hardwareArch();
|
|
@@ -130,7 +143,7 @@ function resolveBinary() {
|
|
|
130
143
|
);
|
|
131
144
|
}
|
|
132
145
|
|
|
133
|
-
const binPath = join(dirname(entry), "bin",
|
|
146
|
+
const binPath = join(dirname(entry), "bin", BINARY_NAME);
|
|
134
147
|
if (!existsSync(binPath)) {
|
|
135
148
|
throw new Error(
|
|
136
149
|
`@pylonsync/cli: binary missing at ${binPath}.\n` +
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pylonsync/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "Pylon CLI — `pylon dev`, `pylon start`, `pylon migrate`, etc. Bundles the native binary for your platform via optionalDependencies, no postinstall script required.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://pylonsync.com",
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
"node": ">=18"
|
|
26
26
|
},
|
|
27
27
|
"optionalDependencies": {
|
|
28
|
-
"@pylonsync/cli-darwin-arm64": "0.
|
|
29
|
-
"@pylonsync/cli-linux-x64": "0.
|
|
28
|
+
"@pylonsync/cli-darwin-arm64": "0.8.1",
|
|
29
|
+
"@pylonsync/cli-linux-x64": "0.8.1",
|
|
30
|
+
"@pylonsync/cli-win32-x64": "0.8.1"
|
|
30
31
|
}
|
|
31
32
|
}
|