From 298b66ce6fdf9dcbfdaccf77daadfe6250e29821 Mon Sep 17 00:00:00 2001 From: Sam Al-Sapti Date: Tue, 27 Sep 2022 18:39:37 +0200 Subject: [PATCH] Fix get_ip() --- zsh/.config/zsh/functions.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zsh/.config/zsh/functions.zsh b/zsh/.config/zsh/functions.zsh index 386e84a..19290b2 100644 --- a/zsh/.config/zsh/functions.zsh +++ b/zsh/.config/zsh/functions.zsh @@ -33,9 +33,10 @@ doasedit() { get_ip() { (( ${+commands[curl]} )) || return 2 + local ARGS=() while [[ $# -gt 0 ]]; do - [[ $1 == --ip ]] && local IP="?ip=$2" && shift || local ARGS+=("$1") + [[ $1 == --ip ]] && local IP="?ip=$2" && shift || ARGS+=("$1") shift done @@ -45,7 +46,6 @@ get_ip() { http() { (( ${+commands[python]} )) || return 2 - [[ $# -gt 0 ]] && local DIR="--directory=$1" && shift eval "python -m http.server 8080 --bind 127.0.0.1 $DIR $@" }