浏览代码

updated install script to check for commands

Leo dev 4 天之前
父节点
当前提交
82c1022a66
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8 0
      install.sh

+ 8 - 0
install.sh

@@ -8,6 +8,14 @@ SERVICE_FILE="/etc/systemd/system/$SERVICE_NAME.service"
 NODE_BIN="$(which node)"
 NODE_BIN="$(which node)"
 RUN_USER="$(whoami)"  # change if needed
 RUN_USER="$(whoami)"  # change if needed
 
 
+# Check for required commands
+for cmd in node npm git sudo; do
+    if ! command -v "$cmd" &> /dev/null; then
+        echo "Error: Required command '$cmd' is not installed or not in PATH. For more info: https://github.com/orus-dev/sentryx/wiki/Common-errors" >&2
+        exit 1
+    fi
+done
+
 # Backup if exists
 # Backup if exists
 if [ -d "$INSTALL_DIR" ]; then
 if [ -d "$INSTALL_DIR" ]; then
     echo "Sentryx already exists, backing up..."
     echo "Sentryx already exists, backing up..."