aboutsummaryrefslogtreecommitdiff
path: root/bin/serve
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2022-12-02 20:52:59 -0300
committerEuAndreh <eu@euandre.org>2022-12-02 20:52:59 -0300
commit9bf50b58674e02a717241577d79c727b75bb01a3 (patch)
tree85a0a25ad273c6c73555161f90ee34b5d9dee860 /bin/serve
parentbin/serve: Do not wait for the browser before start listening (diff)
downloaddotfiles-9bf50b58674e02a717241577d79c727b75bb01a3.tar.gz
dotfiles-9bf50b58674e02a717241577d79c727b75bb01a3.tar.xz
bin/serve: Find a port instead of having a hard-coded fallback
Diffstat (limited to 'bin/serve')
-rwxr-xr-xbin/serve4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/serve b/bin/serve
index e2a1009..82a0663 100755
--- a/bin/serve
+++ b/bin/serve
@@ -15,7 +15,7 @@ help() {
Options:
-d DIRECTORY the directory to serve (default: ".")
- -p PORT the port to listen on (default: 8000)
+ -p PORT the port to listen on (default: find one)
-h, --help show this message
@@ -53,7 +53,7 @@ for flag in "$@"; do
done
DIRECTORY='.'
-PORT=8000
+PORT="$(free-port)"
while getopts 'd:p:h' flag; do
case "$flag" in
d)