From 4385d5ce5a8f8c9c2325bf8419301c4f5e423ffe Mon Sep 17 00:00:00 2001 From: Ayo Date: Mon, 22 Sep 2025 10:38:42 +0200 Subject: [PATCH] feat(ai): extract other args --- ai.sh | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) diff --git a/ai.sh b/ai.sh index 153487f..9c7f01e 100755 --- a/ai.sh +++ b/ai.sh @@ -8,39 +8,9 @@ modelfile=$helper_modelfile # Initialize variables typora_flag=false -other_args="" - -# Process arguments to handle -t flag and collect other args -while [[ $# -gt 0 ]]; do - case $1 in - -t) - typora_flag=true - shift - ;; - *) - other_args="$other_args $1" - shift - ;; - esac -done - -# Set other_args to the first argument if it exists, otherwise empty string -if [[ -n "$other_args" ]]; then - # Remove leading space - other_args="${other_args# }" - - IFS=' ' read -ra args_array <<< "$other_args" - if [[ ${#args_array[@]} -gt 1 ]]; then - # Remove first element and rejoin remaining elements - other_args="${args_array[*]:1}" - else - # If there's only one argument, set other_args to empty string - other_args="" - fi -fi +other_args=${@:2} if ! [ "$other_args" = "" ]; then - if [ "$other_args" = "open-webui" ]; then . $HOME/open-webui/.venv/bin/activate open-webui serve