diff --git a/install.sh b/install.sh index 9ba3744..f7055cc 100644 --- a/install.sh +++ b/install.sh @@ -10,11 +10,11 @@ for cmd in node npm git sudo; do done REPO_URL="https://github.com/orus-dev/sentryx.git" -INSTALL_DIR="$HOME/sentryx" # expanded +INSTALL_DIR="$HOME/sentryx" SERVICE_NAME="sentryx" SERVICE_FILE="/etc/systemd/system/$SERVICE_NAME.service" NODE_BIN="$(which node)" -RUN_USER="$(whoami)" # change if needed +RUN_USER="$(whoami)" # Backup if exists if [ -d "$INSTALL_DIR" ]; then @@ -26,12 +26,12 @@ fi # Clone as current user git clone "$REPO_URL" "$INSTALL_DIR" -# Build as current user inside INSTALL_DIR -cd $INSTALL_DIR +# Build as current user +cd "$INSTALL_DIR" npm install npm run build -# Create systemd service file with absolute ExecStart path +# Create systemd service echo "Creating systemd service..." sudo tee "$SERVICE_FILE" > /dev/null <