-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·64 lines (53 loc) · 1.22 KB
/
run.sh
File metadata and controls
executable file
·64 lines (53 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
BUILD_MODE=false
usage() {
cat <<'USAGE'
Usage: ./run.sh [--build] [--help]
Options:
--build Build release executable (tauri build) instead of running dev mode.
--help Show this help.
USAGE
}
for arg in "$@"; do
case "$arg" in
--build)
BUILD_MODE=true
;;
--help|-h)
usage
exit 0
;;
*)
echo "Unknown argument: $arg"
usage
exit 1
;;
esac
done
require_cmd() {
if ! command -v "$1" >/dev/null 2>&1; then
echo "Missing required command: $1"
exit 1
fi
}
echo "[clip-it] Checking toolchain..."
require_cmd npm
require_cmd cargo
if [ ! -d "ui" ] || [ ! -f "package.json" ] || [ ! -f "ui/package.json" ]; then
echo "[clip-it] Project structure not found. Run this script from the repository root."
exit 1
fi
echo "[clip-it] Installing root dependencies..."
npm install
echo "[clip-it] Installing UI dependencies..."
npm --prefix ui install
if [ "$BUILD_MODE" = true ]; then
echo "[clip-it] Building release executable..."
npm run tauri:build
else
echo "[clip-it] Starting full app in development mode..."
npm run tauri:dev
fi