Fix http() and get_ip()
This commit is contained in:
parent
bca632295f
commit
829b6a2310
|
@ -42,14 +42,15 @@ get_ip() {
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
eval "curl ${ARGS[@]} -fsSL 'https://ifconfig.co/json$IP' \
|
(( ${+commands[jq]} )) && local JQ="| jq"
|
||||||
$( (( ${+commands[jq]} )) && echo "| jq" )"
|
eval "curl ${ARGS[@]} -fsSL 'https://ifconfig.co/json$IP' $JQ"
|
||||||
}
|
}
|
||||||
|
|
||||||
http() {
|
http() {
|
||||||
(( ${+commands[python]} )) || return 2
|
(( ${+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() {
|
open() {
|
||||||
|
|
Loading…
Reference in a new issue