-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathinstall.sh
executable file
·52 lines (41 loc) · 1.31 KB
/
install.sh
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
#!/usr/bin/env bash
#Tool = app-manager installer
#Version = 0.1
#Author = ASHWINI SAHU
#GitHub = ASHWIN990
#Date = 12/10/2022
#Written in Bash
# set -euo pipefail
function install() {
if [ "$1" == "file" ]; then
echo -e "Installing from the existing file"
echo -e "File path : $PWD/app-manager"
elif [ "$1" == "internet" ]; then
echo -e "Installing from the internet"
echo -e "URL : https://raw.githubusercontent.com/ASHWIN990/app-manager/main/app-manager"
fi
if [ ! -d "$HOME/.local/bin/" ]; then
mkdir -p "$HOME/.local/bin/"
fi
if [ "$(command -v app-manager)" ]; then
message=$(echo -e "\napp-manager already installed in $(command -v app-manager)\nInstall it anyway : (Y/n) ? : ")
read -rp "$message" yn
case $yn in
[Nn]*)
echo -e "\nAborting the installation !"
exit 0
;;
esac
fi
if [ "$1" == "internet" ]; then
echo "Downloading the app-manager" && wget -q "https://raw.githubusercontent.com/ASHWIN990/app-manager/main/app-manager"
fi
chmod +x "$PWD/app-manager"
cp "$PWD/app-manager" "$HOME/.local/bin/"
echo -e "\nInstallation done succesfully in $(command -v app-manager)"
}
if [ -e app-manager ]; then
install "file"
else
install "internet"
fi