@syengup/friday-channel-next 0.0.31 → 0.0.32
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/{cli.mjs → install.js} +17 -13
- package/package.json +3 -3
package/{cli.mjs → install.js}
RENAMED
|
@@ -29,7 +29,9 @@ function realHome() {
|
|
|
29
29
|
const USER_HOME = realHome();
|
|
30
30
|
const PLUGIN_DIR = process.argv[2] || join(USER_HOME, ".openclaw", "extensions", "friday-channel-next");
|
|
31
31
|
const OPENCLAW_CONFIG = join(USER_HOME, ".openclaw", "openclaw.json");
|
|
32
|
+
const REPO_URL = process.env.FRIDAY_NEXT_REPO || "https://github.com/SyengUp/openclaw-fridaynext-channel.git";
|
|
32
33
|
|
|
34
|
+
const G = (s) => `\x1b[32m${s}\x1b[0m`;
|
|
33
35
|
const Y = (s) => `\x1b[33m${s}\x1b[0m`;
|
|
34
36
|
const R = (s) => `\x1b[31m${s}\x1b[0m`;
|
|
35
37
|
function log(msg) {
|
|
@@ -122,7 +124,7 @@ if (!existsSync(OPENCLAW_CONFIG)) {
|
|
|
122
124
|
|
|
123
125
|
// --------------- acquire source ---------------
|
|
124
126
|
|
|
125
|
-
|
|
127
|
+
if (isRunningFromNpmPackage()) {
|
|
126
128
|
log(`Copying plugin from npm package to ${PLUGIN_DIR} ...`);
|
|
127
129
|
cpSync(__dirname, PLUGIN_DIR, {
|
|
128
130
|
recursive: true,
|
|
@@ -133,22 +135,24 @@ function copyFromNpmPackage() {
|
|
|
133
135
|
return ![".git", "node_modules", "dist", "attachments", ".claude"].includes(top);
|
|
134
136
|
},
|
|
135
137
|
});
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
if (isRunningFromNpmPackage()) {
|
|
139
|
-
copyFromNpmPackage();
|
|
140
138
|
} else if (existsSync(PLUGIN_DIR)) {
|
|
141
139
|
log(`Plugin directory found: ${PLUGIN_DIR}`);
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
140
|
+
if (existsSync(join(PLUGIN_DIR, ".git"))) {
|
|
141
|
+
try {
|
|
142
|
+
log("Pulling latest changes...");
|
|
143
|
+
execSync("git fetch origin && git checkout -f origin/main", { cwd: PLUGIN_DIR, stdio: "pipe" });
|
|
144
|
+
log("Updated to latest version.");
|
|
145
|
+
} catch {
|
|
146
|
+
warn("Could not update from git — continuing with existing source.");
|
|
147
|
+
}
|
|
148
148
|
}
|
|
149
149
|
} else {
|
|
150
|
-
|
|
151
|
-
|
|
150
|
+
if (!has("git")) {
|
|
151
|
+
err("git is required for installation from GitHub. Install git first or use npx @openclaw/friday-channel-next.");
|
|
152
|
+
process.exit(1);
|
|
153
|
+
}
|
|
154
|
+
log(`Cloning plugin to ${PLUGIN_DIR} ...`);
|
|
155
|
+
execSync(`git clone "${REPO_URL}" "${PLUGIN_DIR}"`, { stdio: "inherit" });
|
|
152
156
|
}
|
|
153
157
|
|
|
154
158
|
process.chdir(PLUGIN_DIR);
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@syengup/friday-channel-next",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.32",
|
|
4
4
|
"description": "OpenClaw Friday Next Apple channel plugin",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
7
7
|
"index.ts",
|
|
8
8
|
"src/",
|
|
9
|
-
"
|
|
9
|
+
"install.js",
|
|
10
10
|
"tsconfig.json",
|
|
11
11
|
"openclaw.plugin.json"
|
|
12
12
|
],
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"test:msg-live": "node scripts/message-roundtrip-live.mjs"
|
|
20
20
|
},
|
|
21
21
|
"bin": {
|
|
22
|
-
"friday-channel-next": "
|
|
22
|
+
"friday-channel-next": "install.js"
|
|
23
23
|
},
|
|
24
24
|
"main": "./dist/index.js",
|
|
25
25
|
"types": "./dist/index.d.ts",
|