-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·75 lines (63 loc) · 1.63 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·75 lines (63 loc) · 1.63 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
65
66
67
68
69
70
71
72
73
74
75
# Install prerequisites for Linux & macOS
cmd_exists() {
command -v "$1" >/dev/null 2>&1
}
install_bun() {
if cmd_exists bun; then
echo "Bun v$(bun --version) already installed"
return
fi
echo "Installing Bun..."
curl -fsSL https://bun.sh/install | bash
echo "Bun v$(bun --version) successfully installed"
}
detect_distro() {
if cmd_exists apt-get; then
DISTRO="debian"
fi
}
# https://tauri.app/start/prerequisites/
install_tauri_system_deps() {
detect_distro
echo "Installing system dependencies for Tauri on $DISTRO..."
case $DISTRO in
"debian")
sudo apt-get update
sudo apt-get install libwebkit2gtk-4.1-dev build-essential curl wget \
file libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev
;;
*)
echo "ERROR: Unsupported Linux distribution ($DISTRO)"
exit 1
;;
esac
}
install_rust() {
if cmd_exists rustc && cmd_exists cargo; then
echo "Rust ($(rustc --version)) is already installed"
return
fi
echo "Installing Rust..."
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh
source ~/.cargo/env
echo "Rust ($(rustc --version)) successfully installed"
}
install_tauri() {
install_tauri_system_deps
install_rust
}
install_packages() {
echo "Installing packages with Bun..."
bun i
if cmd_exists bun tauri; then
echo "Packages successfully installed!"
echo "Tauri CLI installed $(bun tauri --version)"
else
echo "Something went wrong installing packages..."
fi
}
install_bun
install_tauri
install_packages
echo "🎉 Setup complete!"
echo "Run the dev scripts in package.json to begin development"