Skip to content

Commit 322c5d7

Browse files
author
Nhoya
committed
fixed serious problem with shrinking, added autodownload in -u option
1 parent 0ff91a3 commit 322c5d7

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

z0r

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ readonly YELLOW="\033[00;33m"
2222
readonly BOLD="\033[01m"
2323
readonly FINE="\033[0m"
2424

25-
ver='v1.6.2'
25+
ver='v1.7'
2626
regex='(https?|ftp|file)://[-A-Za-z0-9\+&@#/%?=~_|!:,.;]*\.[A-Za-z0-9\+&@%#/=~_|():?]+'
2727
is_z0r='http://z0r.it/[^ \n]'
2828
url=(http://$1)
@@ -125,7 +125,7 @@ is_url(){
125125
checkdep(){
126126
for i in "${dep[@]}"; do
127127
if ( ! which $i &>/dev/null ); then
128-
echo -e $RED"$i not found, solve the dipendencies before running the script"$FINE
128+
echo -e $RED"$i not found, solve the dipendencies before running the script"$FINE
129129
missing="1"
130130
fi
131131
done
@@ -143,7 +143,15 @@ del_history(){
143143
check_ver(){
144144
r_ver=$(curl -s "https://api.github.com/repos/InforgeNet/z0r-script/releases" | egrep -m 1 --color 'tag_name":\s*".*"' | cut -d '"' -f 4)
145145
if [ ! "$r_ver" = "$ver" ]; then
146-
echo -e $GREEN"Update found(https://github.com/InforgeNet/z0r-script)"$FINE
146+
echo -e $BLUE"$r_ver"$FINE $GREEN"update found(https://github.com/InforgeNet/z0r-script)"$FINE
147+
echo -e $GREEN"Want to download the $r_ver release(zipball)?[y/n]"$FINE
148+
read input
149+
case $input in
150+
[Yy]) wget -q --show-progress https://github.com/InforgeNet/z0r-script/zipball/master -O $HOME/z0r-$r_ver.zip
151+
;;
152+
*) exit 0
153+
;;
154+
esac
147155
else
148156
echo -e $RED"No update found"$FINE
149157
fi
@@ -193,12 +201,11 @@ done
193201
checkdep
194202
if [ "$missing" == "1" ]; then
195203
exit 0
196-
else
204+
fi
197205
opsparser $@
198-
if [ "$#"=="0" ]; then
206+
if [ "$#" == "0" ]; then
199207
set -- "$clip"
200208
is_url $1
201209
else
202210
is_url $1 $2
203211
fi
204-
fi

0 commit comments

Comments
 (0)