@keychat-io/keychat-openclaw 0.1.15 โ 0.1.16
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/package.json +1 -1
- package/scripts/install.sh +7 -0
- package/scripts/postinstall.mjs +10 -1
package/package.json
CHANGED
package/scripts/install.sh
CHANGED
|
@@ -10,6 +10,13 @@ BINARY="$INSTALL_DIR/bridge/target/release/keychat-openclaw"
|
|
|
10
10
|
echo "๐ Installing Keychat"
|
|
11
11
|
echo ""
|
|
12
12
|
|
|
13
|
+
# โโ Clean up conflicting installs โโ
|
|
14
|
+
NPM_DIR="${OPENCLAW_EXTENSIONS:-$HOME/.openclaw/extensions}/keychat-openclaw"
|
|
15
|
+
if [ -d "$NPM_DIR" ] && [ "$INSTALL_DIR" != "$NPM_DIR" ]; then
|
|
16
|
+
echo "๐งน Removing npm-installed copy ($NPM_DIR)..."
|
|
17
|
+
rm -rf "$NPM_DIR"
|
|
18
|
+
fi
|
|
19
|
+
|
|
13
20
|
# โโ Check OpenClaw โโ
|
|
14
21
|
if ! command -v openclaw &>/dev/null; then
|
|
15
22
|
echo "โ OpenClaw not found. Install it first: https://docs.openclaw.ai"
|
package/scripts/postinstall.mjs
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Runs automatically after `npm install` / `openclaw plugins install`.
|
|
5
5
|
* Uses native fetch/https โ no child_process dependency.
|
|
6
6
|
*/
|
|
7
|
-
import { existsSync, mkdirSync, chmodSync, writeFileSync, readFileSync } from "node:fs";
|
|
7
|
+
import { existsSync, mkdirSync, chmodSync, writeFileSync, readFileSync, rmSync } from "node:fs";
|
|
8
8
|
import { join, dirname } from "node:path";
|
|
9
9
|
import { fileURLToPath } from "node:url";
|
|
10
10
|
import https from "node:https";
|
|
@@ -25,6 +25,15 @@ const currentVersion = existsSync(versionFile)
|
|
|
25
25
|
? readFileSync(versionFile, "utf-8").trim()
|
|
26
26
|
: null;
|
|
27
27
|
|
|
28
|
+
// Clean up conflicting script-installed copy (extensions/keychat vs extensions/keychat-openclaw)
|
|
29
|
+
const pluginDir = join(__dirname, "..");
|
|
30
|
+
const pluginDirName = pluginDir.split("/").pop();
|
|
31
|
+
const scriptInstallDir = join(pluginDir, "..", "keychat");
|
|
32
|
+
if (pluginDirName === "keychat-openclaw" && existsSync(scriptInstallDir)) {
|
|
33
|
+
console.log(`[keychat] Removing conflicting script-installed copy...`);
|
|
34
|
+
try { rmSync(scriptInstallDir, { recursive: true, force: true }); } catch {}
|
|
35
|
+
}
|
|
36
|
+
|
|
28
37
|
if (existsSync(BINARY_PATH) && currentVersion === pkgVersion) {
|
|
29
38
|
console.log(`[keychat] Binary already exists (v${pkgVersion}), skipping download`);
|
|
30
39
|
process.exit(0);
|