-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·46 lines (39 loc) · 858 Bytes
/
install.sh
File metadata and controls
executable file
·46 lines (39 loc) · 858 Bytes
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
#!/bin/bash
set -e
if [ "$EUID" -ne 0 ]; then
echo "Error: Run with doas/sudo."
exit 1
fi
TARGET_DIR="$(git --exec-path)"
echo "What would you like to install?"
echo "1) git-cloneall"
echo "2) git-quickpush"
echo "3) All utilities"
read -p "Enter choice [1-3]: " CHOICE
install_tool() {
local tool=$1
if [ -f "$tool" ]; then
chmod +x "$tool"
install -m 0755 "$tool" "$TARGET_DIR/$tool"
echo "Installed: $TARGET_DIR/$tool"
else
echo "Error: File '$tool' not found in current directory."
fi
}
case $CHOICE in
1)
install_tool "git-cloneall"
;;
2)
install_tool "git-quickpush"
;;
3)
install_tool "git-cloneall"
install_tool "git-quickpush"
;;
*)
echo "Invalid choice. Exiting."
exit 1
;;
esac
echo "Done! You can now use the commands as 'git <toolname>'"