@degausai/wonda 1.35.0 → 1.38.0
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/install.js +21 -5
- package/package.json +7 -7
package/install.js
CHANGED
|
@@ -3,6 +3,7 @@ const {
|
|
|
3
3
|
copyFileSync,
|
|
4
4
|
chmodSync,
|
|
5
5
|
existsSync,
|
|
6
|
+
readFileSync,
|
|
6
7
|
unlinkSync,
|
|
7
8
|
} = require("fs");
|
|
8
9
|
const { join } = require("path");
|
|
@@ -58,14 +59,29 @@ chmodSync(destPath, 0o755);
|
|
|
58
59
|
|
|
59
60
|
const WONDA_BIN_DIR = join(homedir(), ".wonda", "bin");
|
|
60
61
|
const CURL_BINARY = join(WONDA_BIN_DIR, "wonda");
|
|
62
|
+
const CHANNEL_FILE = join(homedir(), ".wonda", "install-channel");
|
|
61
63
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
+
function readInstallChannel() {
|
|
65
|
+
try {
|
|
66
|
+
return readFileSync(CHANNEL_FILE, "utf8").trim();
|
|
67
|
+
} catch {
|
|
68
|
+
return "";
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// 1. Detect curl/shell installer (~/.wonda/bin/wonda). The macOS .pkg installs
|
|
73
|
+
// to the same path and its LaunchAgent execs it — never remove a pkg-managed
|
|
74
|
+
// binary (the pkg postinstall marks it via ~/.wonda/install-channel).
|
|
75
|
+
if (existsSync(CURL_BINARY) && readInstallChannel() === "pkg") {
|
|
76
|
+
console.warn(
|
|
77
|
+
`\n⚠ wonda is also installed by the Wonda Mac app at ${CURL_BINARY}.\n` +
|
|
78
|
+
` Leaving it in place: the background relay (LaunchAgent) runs from it.\n` +
|
|
79
|
+
` The npm version may shadow it on your PATH depending on ordering.`,
|
|
80
|
+
);
|
|
81
|
+
} else if (existsSync(CURL_BINARY)) {
|
|
64
82
|
try {
|
|
65
83
|
unlinkSync(CURL_BINARY);
|
|
66
|
-
console.log(
|
|
67
|
-
`\n⚠ Removed previous shell-installed wonda at ${CURL_BINARY}`,
|
|
68
|
-
);
|
|
84
|
+
console.log(`\n⚠ Removed previous shell-installed wonda at ${CURL_BINARY}`);
|
|
69
85
|
} catch {
|
|
70
86
|
console.warn(
|
|
71
87
|
`\n⚠ Found a previous shell-installed wonda at ${CURL_BINARY}\n` +
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@degausai/wonda",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.38.0",
|
|
4
4
|
"description": "AI-powered content generation CLI",
|
|
5
5
|
"homepage": "https://wonda.sh",
|
|
6
6
|
"repository": {
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
"postinstall": "node install.js"
|
|
19
19
|
},
|
|
20
20
|
"optionalDependencies": {
|
|
21
|
-
"@degausai/wonda-darwin-arm64": "1.
|
|
22
|
-
"@degausai/wonda-darwin-x64": "1.
|
|
23
|
-
"@degausai/wonda-linux-x64": "1.
|
|
24
|
-
"@degausai/wonda-linux-arm64": "1.
|
|
25
|
-
"@degausai/wonda-win32-x64": "1.
|
|
26
|
-
"@degausai/wonda-win32-arm64": "1.
|
|
21
|
+
"@degausai/wonda-darwin-arm64": "1.38.0",
|
|
22
|
+
"@degausai/wonda-darwin-x64": "1.38.0",
|
|
23
|
+
"@degausai/wonda-linux-x64": "1.38.0",
|
|
24
|
+
"@degausai/wonda-linux-arm64": "1.38.0",
|
|
25
|
+
"@degausai/wonda-win32-x64": "1.38.0",
|
|
26
|
+
"@degausai/wonda-win32-arm64": "1.38.0"
|
|
27
27
|
}
|
|
28
28
|
}
|