@akash-chowdhury-24/deployhub 2.0.23 → 2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akash-chowdhury-24/deployhub",
3
- "version": "2.0.23",
3
+ "version": "2.0.26",
4
4
  "description": "Zero-configuration deployment and artifact manager",
5
5
  "type": "module",
6
6
  "main": "./src/cli/index.js",
@@ -290,9 +290,16 @@ export function createSshProvider(config, envName, env = process.env) {
290
290
  /**
291
291
  * Start a nohup process with DEPLOYHUB_APP marker and write PID file.
292
292
  * Marker is set in environ AND embedded as argv0 via `bash exec -a` so it
293
- * appears in /proc/cmdline (pkill -f / cmdline scans can see it). Plain
293
+ * appears in /proc/cmdline (cmdline scans can see it). Plain
294
294
  * `VAR=value cmd` alone only puts the marker in environ.
295
295
  *
296
+ * Critical shell-precedence note: `cd dir && nohup cmd & echo $!` is parsed
297
+ * as `(cd dir && nohup cmd) & echo $!`. Backgrounding that AND-list leaves
298
+ * the SSH session's bash waiting on the still-running app, so node-ssh never
299
+ * sees channel completion (false deploy failure) even though the process
300
+ * started. Brace-group so only nohup is backgrounded:
301
+ * `cd dir && { nohup cmd & echo $!; }`
302
+ *
296
303
  * @param {import('node-ssh').NodeSSH} ssh
297
304
  * @param {string} targetPath
298
305
  * @param {string} command — command body after `nohup` (no trailing &)
@@ -305,7 +312,7 @@ export function createSshProvider(config, envName, env = process.env) {
305
312
  // bash exec -a puts DEPLOYHUB_APP=… in argv0 of the real process after exec.
306
313
  await exec(
307
314
  ssh,
308
- `cd ${dir} && DEPLOYHUB_APP=${sh(appName)} nohup bash -c 'exec -a "$0" "$@"' ${markerArg} ${command} > app.log 2>&1 </dev/null & echo $! > ${sh(pidFile)}`,
315
+ `cd ${dir} && { DEPLOYHUB_APP=${sh(appName)} nohup bash -c 'exec -a "$0" "$@"' ${markerArg} ${command} > app.log 2>&1 </dev/null & echo $! > ${sh(pidFile)}; }`,
309
316
  { timeoutMs: startStopTimeoutMs }
310
317
  );
311
318
  await assertPidAliveAfterStart(ssh, targetPath);