octoally 1.0.21 → 1.0.23
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 +30 -1
- package/package.json +1 -1
package/cli.mjs
CHANGED
|
@@ -133,13 +133,42 @@ function runUpdate(version) {
|
|
|
133
133
|
}
|
|
134
134
|
execSync(`rm -rf "${extractDir}"`, { stdio: "pipe" });
|
|
135
135
|
|
|
136
|
-
// Install server dependencies
|
|
136
|
+
// Install server dependencies (native modules like better-sqlite3)
|
|
137
137
|
log(CYAN, "Installing dependencies...");
|
|
138
138
|
execSync(`npm install --omit=dev --prefix "${INSTALL_DIR}/server"`, {
|
|
139
139
|
cwd: INSTALL_DIR,
|
|
140
140
|
stdio: "inherit",
|
|
141
141
|
});
|
|
142
142
|
|
|
143
|
+
// Update desktop app (.deb) if installed
|
|
144
|
+
try {
|
|
145
|
+
execSync("dpkg -l octoally-desktop", { stdio: "pipe" });
|
|
146
|
+
// Desktop app is installed — download and update it
|
|
147
|
+
const debUrl = `https://github.com/${GITHUB_REPO}/releases/download/v${version}/octoally-desktop_${version}_amd64.deb`;
|
|
148
|
+
const debFile = `/tmp/octoally-desktop_${version}_amd64.deb`;
|
|
149
|
+
log(CYAN, "Updating desktop app...");
|
|
150
|
+
execSync(`curl -fsSL -o "${debFile}" "${debUrl}"`, { stdio: "pipe" });
|
|
151
|
+
// Kill running desktop app before dpkg replaces the binary
|
|
152
|
+
try {
|
|
153
|
+
execSync('pkill -f "octoally-desktop"', { stdio: "pipe" });
|
|
154
|
+
execSync("sleep 1", { stdio: "pipe" });
|
|
155
|
+
execSync('pkill -9 -f "octoally-desktop"', { stdio: "pipe" });
|
|
156
|
+
} catch {}
|
|
157
|
+
execSync(`sudo dpkg -i "${debFile}"`, { stdio: "inherit" });
|
|
158
|
+
execSync(`rm -f "${debFile}"`, { stdio: "pipe" });
|
|
159
|
+
log(GREEN, "Desktop app updated!");
|
|
160
|
+
// Relaunch desktop app in background (fully detached from terminal)
|
|
161
|
+
try {
|
|
162
|
+
const desktop = spawn("octoally-desktop", [], {
|
|
163
|
+
stdio: "ignore",
|
|
164
|
+
detached: true,
|
|
165
|
+
});
|
|
166
|
+
desktop.unref();
|
|
167
|
+
} catch {}
|
|
168
|
+
} catch {
|
|
169
|
+
// Desktop app not installed or .deb not available — skip
|
|
170
|
+
}
|
|
171
|
+
|
|
143
172
|
// Start server
|
|
144
173
|
log(CYAN, "Starting server...");
|
|
145
174
|
execSync(`chmod +x "${LOCAL_CLI}" && "${LOCAL_CLI}" start`, {
|
package/package.json
CHANGED