-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup
executable file
·72 lines (60 loc) · 2.21 KB
/
setup
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
clear
rm -rf ~/.PenDrive
mkdir -p ~/.PenDrive
printf "\nSetting Up PenDrive"
printf "\n\nDownloading PenDrive..."
x=`echo ~`
full=`echo "$x/.PenDrive/pendrive"`
sudo curl -\# https://raw.githubusercontent.com/hellosaumil/PenDrive/master/src/pendrive --output $full
printf "\n\nPenDrive Downloaded!"
printf "\nOS : $OSTYPE"
os_flag="-none"
case "$OSTYPE" in
darwin*)
printf "\nDarwin\n"
z=$(cat ~/.bash_profile | grep "export PATH=\$PATH:~/.PenDrive/")
if [ "$z" == " " -o "$z" == "" ];
then
printf "Aliasing..."
printf "\nexport PATH=\$PATH:~/.PenDrive/" >> ~/.bash_profile
printf "\nalias pendrive=\"~/.PenDrive/pendrive\"" >> ~/.bash_profile;
else
printf "Aliased!";
fi
source ~/.bash_profile
sudo chmod +x ~/.PenDrive/pendrive
printf "\n\nAlias created as \e[1;3;163mpendrive \e[0m"
os_flag=True
;;
*)
printf "\nLinux\n"
z=$(cat ~/.bashrc | grep "export PATH=\$PATH:~/.PenDrive/")
if [ "$z" == " " -o "$z" == "" ];
then
printf "Aliasing..."
printf "\nexport PATH=\$PATH:~/.PenDrive/" >> ~/.bashrc
printf "\nalias pendrive=\"~/.PenDrive/pendrive\"" >> ~/.bashrc;
else
printf "Aliased!";
fi
source ~/.bashrc
sudo chmod +x ~/.PenDrive/pendrive
printf "\n\nAlias created as \e[1;3;163mpendrive \e[0m"
os_flag=True
;;
esac
if [ os_flag != "-none" ]
then
printf "\n$os_flag\n\n"
printf "\n\e[1;163mSYNOPSIS\e[0m"
printf "\n\t\e[1;163mpendrive\e[0m"
printf " [OPTION]... [FILE]... [TEXT]... [TOKEN]... [SERVER]..."
printf "\n\nOpen New Tab see it in Action!"
printf "\n\nPenDrive SetUp Successfully !!!\n"
else
printf "\n\nError in setting up PenDrive"
printf "\n\tReport bugs to "
printf "\e[3;4mhttps://github.com/hellosaumil/PenDrive/issues\e[0m"
fi
# -rwxr-xr-x 1 root staff 18651 Apr 6 13:31 /Users/hellosaumil/.PenDrive/pendrive
# -rw-r--r-- 1 root staff 18651 Apr 6 13:33 /Users/hellosaumil/.PenDrive/pendrive