fixed missing fi in new functionfixed missing fi in new function
This commit is contained in:
parent
35a2ede88b
commit
65f26078f3
1 changed files with 11 additions and 9 deletions
20
functions
20
functions
|
|
@ -221,10 +221,10 @@ box-light(){
|
||||||
bottom_border=${light_h}
|
bottom_border=${light_h}
|
||||||
left_border=${light_v}
|
left_border=${light_v}
|
||||||
right_border=${light_v}
|
right_border=${light_v}
|
||||||
left_top_border=$(echo -e "\u23BE")
|
left_top_border=$(echo -e "\u25AB")
|
||||||
right_top_border=$(echo -e "\u23CB")
|
right_top_border=$(echo -e "\u25AB")
|
||||||
left_bottom_border=$(echo -e "\u23BF")
|
left_bottom_border=$(echo -e "\u25AB")
|
||||||
right_bottom_border=$(echo -e "\u23CC")
|
right_bottom_border=$(echo -e "\u25AB")
|
||||||
box_break_line=$(echo -e "\u23AF")
|
box_break_line=$(echo -e "\u23AF")
|
||||||
;;&
|
;;&
|
||||||
darwin* )
|
darwin* )
|
||||||
|
|
@ -232,10 +232,10 @@ box-light(){
|
||||||
bottom_border=${light_h}
|
bottom_border=${light_h}
|
||||||
left_border=${light_v}
|
left_border=${light_v}
|
||||||
right_border=${light_v}
|
right_border=${light_v}
|
||||||
left_top_border=$(echo -e "⎾")
|
left_top_border=$(echo -e "▫")
|
||||||
right_top_border=$(echo -e "⏋")
|
right_top_border=$(echo -e "▫")
|
||||||
left_bottom_border=$(echo -e "⎿")
|
left_bottom_border=$(echo -e "▫")
|
||||||
right_bottom_border=$(echo -e "⏌")
|
right_bottom_border=$(echo -e "▫")
|
||||||
box_break_line=$(echo -e "⎯")
|
box_break_line=$(echo -e "⎯")
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
@ -543,18 +543,20 @@ run-from-url(){
|
||||||
args=${*:2}
|
args=${*:2}
|
||||||
# check the interpreter using the shebang at the top of the file
|
# check the interpreter using the shebang at the top of the file
|
||||||
interpreter=$(curl -ks $url | head -n 1 | sed -e 's/\#\!//g' 2>/dev/null)
|
interpreter=$(curl -ks $url | head -n 1 | sed -e 's/\#\!//g' 2>/dev/null)
|
||||||
|
boxline "interpreter=$interpreter"
|
||||||
# In case of missing shebang, default to bash
|
# In case of missing shebang, default to bash
|
||||||
if [ -z $interpreter ] ; then
|
if [ -z $interpreter ] ; then
|
||||||
interpreter="/bin/bash"
|
interpreter="/bin/bash"
|
||||||
fi
|
fi
|
||||||
logger boxline "Running online script $url with args $args"
|
logger boxline "Running online script $url with args $args"
|
||||||
if [[ "$interpreter" == "/bin/bash "]] ; then
|
if [[ "$interpreter" == "/bin/bash" ]] ; then
|
||||||
run curl -H 'Cache-Control: no-cache' -ks $url | $interpreter -s -- $args
|
run curl -H 'Cache-Control: no-cache' -ks $url | $interpreter -s -- $args
|
||||||
else
|
else
|
||||||
run curl -H 'Cache-Control: no-cache' -ks $url > ${url##*/}
|
run curl -H 'Cache-Control: no-cache' -ks $url > ${url##*/}
|
||||||
run $interpreter ${url##*/} $args
|
run $interpreter ${url##*/} $args
|
||||||
ec=$?
|
ec=$?
|
||||||
run rm ${url##*/}
|
run rm ${url##*/}
|
||||||
|
fi
|
||||||
return $ec
|
return $ec
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue