Add client/install.sh; fix server/install.sh paths after move
server/install.sh was broken after moving into server/: SCRIPT_DIR now resolves to the server/ subdirectory, so requirements path, log dir, and systemd WorkingDirectory all pointed at wrong locations. Introduce REPO_DIR (parent of SCRIPT_DIR) and use it throughout. client/install.sh creates a venv at client/.venv, installs client/requirements.txt, and writes a client/run.sh launcher. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+5
-4
@@ -15,12 +15,13 @@
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
REPO_DIR="$(dirname "$SCRIPT_DIR")"
|
||||
SERVICE_NAME="we_monitor"
|
||||
CREDS_DIR="$HOME/.config/we_monitor"
|
||||
CREDS_FILE="$CREDS_DIR/credentials.json"
|
||||
SYSTEMD_DIR="$HOME/.config/systemd/user"
|
||||
SERVICE_FILE="$SYSTEMD_DIR/$SERVICE_NAME.service"
|
||||
LOG_DIR="$SCRIPT_DIR/logs"
|
||||
LOG_DIR="$REPO_DIR/logs"
|
||||
|
||||
VENV="$SCRIPT_DIR/.venv"
|
||||
PYTHON="$VENV/bin/python"
|
||||
@@ -40,7 +41,7 @@ if $IS_UPDATE; then
|
||||
else
|
||||
echo "==> we_monitor installer"
|
||||
fi
|
||||
echo " Project : $SCRIPT_DIR"
|
||||
echo " Project : $REPO_DIR"
|
||||
echo " User : $USER"
|
||||
echo ""
|
||||
|
||||
@@ -54,7 +55,7 @@ fi
|
||||
|
||||
echo "==> Installing / updating dependencies"
|
||||
"$VENV/bin/pip" install --quiet --upgrade pip
|
||||
"$VENV/bin/pip" install --quiet --upgrade -r "$SCRIPT_DIR/server/requirements.txt"
|
||||
"$VENV/bin/pip" install --quiet --upgrade -r "$SCRIPT_DIR/requirements.txt"
|
||||
echo " Python : $PYTHON"
|
||||
echo ""
|
||||
|
||||
@@ -100,7 +101,7 @@ Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory=$SCRIPT_DIR
|
||||
WorkingDirectory=$REPO_DIR
|
||||
ExecStart=$PYTHON -m server.main -c $CREDS_FILE
|
||||
Restart=on-failure
|
||||
RestartSec=60
|
||||
|
||||
Reference in New Issue
Block a user