indieclaw-agent 1.3.2 → 1.3.3
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/index.js +3 -26
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -529,35 +529,12 @@ timeout /t 2 /nobreak >nul
|
|
|
529
529
|
npm install -g indieclaw-agent@latest
|
|
530
530
|
start "" indieclaw-agent`;
|
|
531
531
|
} else {
|
|
532
|
-
// Use sudo if not running as root
|
|
533
|
-
const needsSudo = process.getuid && process.getuid() !== 0;
|
|
534
|
-
const sudo = needsSudo ? 'sudo ' : '';
|
|
535
|
-
|
|
536
532
|
script = `#!/bin/bash
|
|
537
533
|
exec > /tmp/indieclaw-update.log 2>&1
|
|
538
534
|
echo "[$(date)] Starting agent update..."
|
|
539
|
-
sleep
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
if [ -f /etc/systemd/system/indieclaw-agent.service ]; then
|
|
543
|
-
${sudo}systemctl stop indieclaw-agent 2>/dev/null
|
|
544
|
-
echo "[$(date)] Stopped systemd service"
|
|
545
|
-
fi
|
|
546
|
-
|
|
547
|
-
${sudo}${npmPath} install -g indieclaw-agent@latest 2>&1 || ${npmPath} install -g indieclaw-agent@latest 2>&1
|
|
548
|
-
echo "[$(date)] Install exit code: $?"
|
|
549
|
-
|
|
550
|
-
echo "[$(date)] Restarting..."
|
|
551
|
-
if [ -f /etc/systemd/system/indieclaw-agent.service ]; then
|
|
552
|
-
${sudo}systemctl start indieclaw-agent
|
|
553
|
-
echo "[$(date)] Started via systemctl"
|
|
554
|
-
elif launchctl list com.indieclaw.agent &>/dev/null 2>&1; then
|
|
555
|
-
launchctl kickstart -k gui/$(id -u)/com.indieclaw.agent
|
|
556
|
-
echo "[$(date)] Restarted via launchctl"
|
|
557
|
-
else
|
|
558
|
-
nohup indieclaw-agent > /tmp/indieclaw-agent.log 2>&1 &
|
|
559
|
-
echo "[$(date)] Started via nohup (pid $!)"
|
|
560
|
-
fi`;
|
|
535
|
+
sleep 2
|
|
536
|
+
sudo ${npmPath} install -g indieclaw-agent@latest && sudo systemctl restart indieclaw-agent
|
|
537
|
+
echo "[$(date)] Done (exit code: $?)"`;
|
|
561
538
|
}
|
|
562
539
|
|
|
563
540
|
const ext = platform === 'win32' ? '.bat' : '.sh';
|