From 41cb0fe549b327d2ecf9983a64cc5c0fb8aae79e Mon Sep 17 00:00:00 2001 From: Dict Xiong Date: Thu, 13 Aug 2026 16:26:51 +0800 Subject: [PATCH] fix: syntax --- functions/_riot | 2 +- scripts/riot | 2 +- tools/common.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/functions/_riot b/functions/_riot index fd663cb..1b044df 100644 --- a/functions/_riot +++ b/functions/_riot @@ -80,7 +80,7 @@ _riot_presets() { [[ -z $DOTFILES ]] || config_files+=("$DOTFILES/riot-config.sh") config_files+=("$HOME/.config/riot-config.sh" "$PWD/riot-config.sh") - for file in "$config_files[@]"; do + for file in "${config_files[@]}"; do [[ -r $file ]] || continue presets+=("${(@f)$(sed -nE 's/^([[:alnum:]_.-]+)\.(remote|batch)\(\).*/\1/p' "$file" 2>/dev/null)}") done diff --git a/scripts/riot b/scripts/riot index c572adf..93a27bb 100755 --- a/scripts/riot +++ b/scripts/riot @@ -542,7 +542,7 @@ router() { local option="" local remaining="" local option_value="" - while [[ $# > 0 || -n "$arg" ]]; do + while [[ $# -gt 0 || -n "$arg" ]]; do if [[ -z "$arg" ]]; then arg=$1 shift diff --git a/tools/common.sh b/tools/common.sh index 0f9c825..328f5f8 100755 --- a/tools/common.sh +++ b/tools/common.sh @@ -12,7 +12,7 @@ if [[ "${BASH_SOURCE[0]}" != "${0}" && "$DFS_SKIP_ARG_PARSE" != "1" ]]; then ORIGIN_ARGS=("$@") ARG="" GOT_OPTS=() - while [[ $# > 0 || -n "$ARG" ]]; do + while [[ $# -gt 0 || -n "$ARG" ]]; do if [[ -z "$ARG" ]]; then if [[ "$1" == "--" ]]; then GOT_OPTS+=("$@"); break; fi ARG="$1"; shift;