addet more functions and a help page for the function
This commit is contained in:
parent
0769dbd8c3
commit
72d02eb3c0
1 changed files with 12 additions and 3 deletions
13
.zshrc
13
.zshrc
|
@ -233,8 +233,17 @@ _alias(){
|
|||
alias dc="docker compose"
|
||||
alias appupdate="docker compose pull && docker compose up -d --force-recreate"
|
||||
drweb() {
|
||||
[[ "$1" == "" ]] && 1="./"
|
||||
docker run -p "8080:80" -v "$1:/usr/share/nginx/html:ro" nginx:alpine
|
||||
if [[ "$1" == "--help" || "$1" == "-h" ]]; then
|
||||
echo "Usage: drweb [directory] [port]"
|
||||
echo " directory: Directory to serve (default: current directory)"
|
||||
echo " port: Port to use (default: 8080)"
|
||||
return
|
||||
fi
|
||||
|
||||
local dir="${1:-./}"
|
||||
local port="${2:-8080}"
|
||||
|
||||
docker run -p "$port:80" -v "$dir:/usr/share/nginx/html:ro" nginx:alpine
|
||||
}
|
||||
fi
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue