Monorepo for Aesthetic.Computer
aesthetic.computer
1#!/usr/bin/env fish
2
3# Script to run the ac-event-daemon (with optional watch mode if cargo-watch available)
4
5echo "🚀 Starting ac-event-daemon..."
6
7# Get the user's HOME directory from the first argument
8set USER_HOME $argv[1]
9
10if test -z "$USER_HOME"
11 echo "Critical: User HOME directory not passed to script. Exiting."
12 exit 1
13end
14
15# Explicitly set RUSTUP_HOME and CARGO_HOME for this script's environment
16set -x RUSTUP_HOME "$USER_HOME/.rustup"
17set -x CARGO_HOME "$USER_HOME/.cargo"
18
19# Ensure the Rust bin directory is in PATH for the current fish session
20if test -d "$CARGO_HOME/bin"
21 fish_add_path "$CARGO_HOME/bin"
22 echo "Added $CARGO_HOME/bin to PATH"
23else
24 echo "Warning: $CARGO_HOME/bin not found. Rust environment might not be set up correctly."
25end
26
27# Navigate to the script's directory to ensure paths are correct
28cd (dirname (status --current-filename))
29
30# Try cargo-watch if available, otherwise just run once
31if command -q cargo-watch
32 echo "Starting cargo watch..."
33 cargo watch -c -w src -w Cargo.toml -x "run --release"
34else
35 echo "⚠ cargo-watch not available (needs Rust 1.85+), running without auto-reload"
36 echo " To enable: rustup update stable"
37 cargo run --release
38end