@syengup/friday-channel-next 0.0.24 → 0.0.26
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 +27 -3
- package/package.json +1 -1
package/install.js
CHANGED
|
@@ -124,9 +124,7 @@ if (!existsSync(OPENCLAW_CONFIG)) {
|
|
|
124
124
|
|
|
125
125
|
// --------------- acquire source ---------------
|
|
126
126
|
|
|
127
|
-
|
|
128
|
-
log(`Plugin directory found: ${PLUGIN_DIR}`);
|
|
129
|
-
} else if (isRunningFromNpmPackage()) {
|
|
127
|
+
function copyFromNpmPackage() {
|
|
130
128
|
log(`Copying plugin from npm package to ${PLUGIN_DIR} ...`);
|
|
131
129
|
cpSync(__dirname, PLUGIN_DIR, {
|
|
132
130
|
recursive: true,
|
|
@@ -137,6 +135,32 @@ if (existsSync(PLUGIN_DIR)) {
|
|
|
137
135
|
return ![".git", "node_modules", "dist", "attachments", ".claude"].includes(top);
|
|
138
136
|
},
|
|
139
137
|
});
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
if (existsSync(PLUGIN_DIR)) {
|
|
141
|
+
log(`Plugin directory found: ${PLUGIN_DIR}`);
|
|
142
|
+
if (existsSync(join(PLUGIN_DIR, ".git"))) {
|
|
143
|
+
try {
|
|
144
|
+
log("Pulling latest changes...");
|
|
145
|
+
execSync("git fetch origin && git checkout -f origin/main", { cwd: PLUGIN_DIR, stdio: "pipe" });
|
|
146
|
+
log("Updated to latest version.");
|
|
147
|
+
} catch {
|
|
148
|
+
warn("Could not update from git — continuing with existing source.");
|
|
149
|
+
}
|
|
150
|
+
} else if (isRunningFromNpmPackage()) {
|
|
151
|
+
copyFromNpmPackage();
|
|
152
|
+
} else {
|
|
153
|
+
// No .git, running locally — re-execute via npx to get the latest
|
|
154
|
+
log("Updating via npx...");
|
|
155
|
+
try {
|
|
156
|
+
execSync("npx -y @syengup/friday-channel-next", { stdio: "inherit" });
|
|
157
|
+
process.exit(0);
|
|
158
|
+
} catch {
|
|
159
|
+
warn("Could not update via npx — continuing with existing source.");
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
} else if (isRunningFromNpmPackage()) {
|
|
163
|
+
copyFromNpmPackage();
|
|
140
164
|
} else {
|
|
141
165
|
if (!has("git")) {
|
|
142
166
|
err("git is required for installation from GitHub. Install git first or use npx @openclaw/friday-channel-next.");
|