-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·53 lines (44 loc) · 1.36 KB
/
run.sh
File metadata and controls
executable file
·53 lines (44 loc) · 1.36 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
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
MODE="dev"
if [[ "${1:-}" == "--build" || "${1:-}" == "build" ]]; then
MODE="build"
shift
elif [[ "${1:-}" == "--help" || "${1:-}" == "-h" ]]; then
cat <<'USAGE'
Usage:
./run.sh # install deps + generate icons if needed + run in dev mode
./run.sh --build # install deps + generate icons if needed + build deployable package
Any extra args are forwarded to the tauri command.
USAGE
exit 0
fi
cd "$ROOT_DIR"
if ! command -v npm >/dev/null 2>&1; then
echo "[error] npm non trovato. Installa Node.js >= 18."
exit 1
fi
if ! command -v cargo >/dev/null 2>&1; then
echo "[error] cargo non trovato. Installa Rust toolchain."
exit 1
fi
if [[ ! -d node_modules ]]; then
echo "[setup] install dipendenze npm..."
npm install
else
echo "[setup] dipendenze npm gia presenti (node_modules)."
fi
if [[ ! -f src-tauri/icons/icon.icns || ! -f src-tauri/icons/icon.ico || ! -f src-tauri/icons/128x128.png ]]; then
echo "[setup] genero set icone da branding/tentacle-icon.png..."
npx tauri icon branding/tentacle-icon.png
else
echo "[setup] icone gia presenti in src-tauri/icons."
fi
if [[ "$MODE" == "build" ]]; then
echo "[run] build deployable package..."
npm run tauri:build -- "$@"
else
echo "[run] avvio in dev mode..."
npm run tauri:dev -- "$@"
fi