-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·67 lines (62 loc) · 2.16 KB
/
install.sh
File metadata and controls
executable file
·67 lines (62 loc) · 2.16 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
#!/usr/bin/env bash
echo "Detecting shell type..."
# Ensure the ~/scripts directory exists
if [ ! -d "$HOME/scripts" ]; then
echo "Creating ~/scripts directory..."
mkdir -p "$HOME/scripts"
fi
# Detect user's shell
case "$SHELL" in
*zsh)
echo "Zsh detected. Copying Zsh script..."
cp scripts/update_packages.sh ~/scripts/update_packages
;;
*bash)
echo "Bash detected. Copying Bash script..."
cp scripts/update_packages.sh ~/scripts/update_packages
;;
*fish)
echo "Fish detected. Copying Fish script..."
cp scripts/update_packages.sh ~/scripts/update_packages
;;
*nu)
echo "NuShell detected. Copying NuShell script..."
cp scripts/update_packages.sh ~/scripts/update_packages
;;
*ksh)
echo "Korn Shell detected. Copying KSH script..."
cp scripts/update_packages.sh ~/scripts/update_packages
;;
*csh|*tcsh)
echo "C Shell/TC Shell detected. Copying CSH script..."
cp scripts/update_packages.sh ~/scripts/update_packages
;;
*dash)
echo "Dash detected. Copying Dash script..."
cp scripts/update_packages.sh ~/scripts/update_packages
;;
*elvish)
echo "Elvish detected. Copying Elvish script..."
cp scripts/update_packages.sh ~/scripts/update_packages
;;
*xonsh)
echo "Xonsh detected. Copying Xonsh script..."
cp scripts/update_packages.sh ~/scripts/update_packages
;;
*busybox)
echo "BusyBox Shell detected. Copying BusyBox script..."
cp scripts/update_packages.sh ~/scripts/update_packages
;;
*sh)
echo "Bourne Shell detected. Copying POSIX sh script..."
cp scripts/update_packages.sh ~/scripts/update_packages
;;
*)
echo "Unsupported shell detected. Using POSIX sh compatible script as fallback..."
cp scripts/update_packages.sh ~/scripts/update_packages
;;
esac
# Make the script executable
chmod +x ~/scripts/update_packages
echo "Installation complete. Script copied to ~/scripts/update_packages."
echo "You can now run the script using '~/scripts/update_packages'."