This repository has been archived by the owner on Jan 12, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjean
executable file
·111 lines (96 loc) · 2.28 KB
/
jean
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#!/bin/sh
#
# Script Name: Jean
# Script Description: Missing Shell Package Manager For Linux
# Script Author: Ziyaddin Sadigov
# Script URL: https://github.com/ziyaddin/jean
# Author URL: http://twitter.com/zsadigov
#
#---MAIN-VARIABLES---#
BASEDIR='/usr/local/bin/jean'
CONF_TEXT='#script made by jean'
#---ENTER-LOCAL-FOLDER---#
cd "$BASEDIR"
#---ENTER-LOCAL-FOLDER---#
#---COMMANDS---#
init() {
cd init;
touch "$PACKNAME.sh";
chmod +x "$PACKNAME.sh";
echo "$CONF_TEXT" > "$PACKNAME.sh";
cd ..;
}
#install command
install() {
echo "Installation starts!"
for i in $(cat packages.txt | grep -w $PACKNAME) ; do
cd packages;
echo $i;
curl -LOk "$i/archive/master.zip";
unzip -q `basename /$i/archive/master.zip`;
rm `basename packages/$i/archive/master.zip`;
ls | grep -i `basename $i-master` | xargs -I {} mv {} `basename $i`;
cd -;
done
}
#update command
update() {
echo 'Updating Packages List...';
curl -LOk "http://raw.github.com/ziyaddin/xampp/master/README.md";
echo 'Updated!';
}
#search command
search(){
for line in $(cat packages.txt | grep -w "http"); do
echo $line;
done
}
#help command
help() {
if [ "`which banner`" = "/usr/bin/banner" ]; then
banner jean;
else
echo "You haven't banner command";
fi
}
#---COMMAND-PROCESS---#
if [ $1 ]; then
case "$1" in
"init")
if [ "$2" ]; then
PACKNAME="$2";
if [ -f $BASEDIR/init/$PACKNAME.sh ]; then
echo "File $PACKNAME is already exists!";
else
init;
fi
else
echo "Please, enter file name for initialization";
fi
;;
"install")
if [ "$2" ]; then
PACKNAME="$2";
if [ -d $BASEDIR/packages/$PACKNAME ]; then
echo "\033[32m Already exists. Are you sure you want to overwrite?\033[0m";
else
install;
fi
else
echo "\033[31mPlease, enter package name!\033[0m";
echo "write as: jean install <package-name>";
fi
;;
"update")
update;
;;
"search")
search;
;;
*)
help;
;;
esac
else
help;
fi