瀏覽代碼

Skip touch app restart in update if service not installed

Check that the systemd service actually exists before attempting to
restart it, not just the directory. This prevents the confusing
"Unit dune-weaver-touch.service not found" error message.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
tuanchris 4 周之前
父節點
當前提交
e6f5c83de8
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      dw

+ 2 - 2
dw

@@ -151,9 +151,9 @@ cmd_update() {
         sudo systemctl restart dune-weaver
     fi
 
-    # Update touch app if installed
+    # Update touch app if installed (check both directory and service exist)
     local touch_dir="$INSTALL_DIR/dune-weaver-touch"
-    if [[ -d "$touch_dir" ]]; then
+    if [[ -d "$touch_dir" ]] && systemctl list-unit-files dune-weaver-touch.service 2>/dev/null | grep -q dune-weaver-touch; then
         echo ""
         echo -e "${BLUE}Updating touch app...${NC}"
         cd "$touch_dir"