-
Notifications
You must be signed in to change notification settings - Fork 0
/
run
31 lines (26 loc) · 977 Bytes
/
run
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
#!/usr/bin/env bash
rm -f -R builddir/ &&
meson setup builddir && cd builddir && ninja && cd .. &&
if [ -f "$(which meson-init-cpp)" ]; then
read -p "Already installed. Do you want to uninstall it? (y/n): " choice
if [ "$choice" == "y" ]; then
if [ "$(id -u)" == 0 ]; then
rm -f -R "$(which meson-init-cpp)"
elif command -v sudo &> /dev/null; then
sudo rm -f -R "$(which meson-init-cpp)"
elif command -v doas &> /dev/null; then
doas rm -f -R "$(which meson-init-cpp)"
fi
fi
else
read -p "Do you want to install meson-init-cpp? (y/n): " installchoice
if [ "$installchoice" == "y" ]; then
if [ "$(id -u)" == 0 ]; then
cp ./builddir/meson_init_cpp /usr/local/bin/meson-init-cpp
elif command -v sudo &> /dev/null; then
sudo cp ./builddir/meson_init_cpp /usr/local/bin/meson-init-cpp
elif command -v doas &> /dev/null; then
doas cp ./builddir/meson_init_cpp /usr/local/bin/meson-init-cpp
fi
fi
fi