Fix http() and get_ip()
This commit is contained in:
parent
bca632295f
commit
829b6a2310
|
@ -42,14 +42,15 @@ get_ip() {
|
|||
shift
|
||||
done
|
||||
|
||||
eval "curl ${ARGS[@]} -fsSL 'https://ifconfig.co/json$IP' \
|
||||
$( (( ${+commands[jq]} )) && echo "| jq" )"
|
||||
(( ${+commands[jq]} )) && local JQ="| jq"
|
||||
eval "curl ${ARGS[@]} -fsSL 'https://ifconfig.co/json$IP' $JQ"
|
||||
}
|
||||
|
||||
http() {
|
||||
(( ${+commands[python]} )) || return 2
|
||||
eval "python -m http.server 8080 --bind 127.0.0.1 \
|
||||
$( [[ $# -gt 0 ]] && echo "--directory $1" ) $@"
|
||||
|
||||
[[ $# -gt 0 ]] && local DIR="--directory=$1" && shift
|
||||
eval "python -m http.server 8080 --bind 127.0.0.1 $DIR $@"
|
||||
}
|
||||
|
||||
open() {
|
||||
|
|
Loading…
Reference in a new issue