Zsh: Add http() function

This commit is contained in:
theanonymousexyz 2022-04-09 19:02:01 +02:00
parent e37c4f2a81
commit 4b5791daa0
No known key found for this signature in database
GPG Key ID: 35EE09F5481049BB
1 changed files with 7 additions and 0 deletions

View File

@ -19,3 +19,10 @@ get_ip() {
eval "curl $ARGS -fsSL 'https://ifconfig.co/json$IP' $JQ"
}
http() {
(( ${+commands[python]} )) || return 1
[[ $# -gt 0 ]] && local DIR="--directory $1"
eval "python -m http.server 8080 --bind 127.0.0.1 $DIR"
}