diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-07-11 13:56:06 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-07-11 13:56:06 +0800 |
| commit | cd39d205f19c5689affbebcae0c26f81ddad1db2 (patch) | |
| tree | a90686cb34253e2dfc6b5cbfd442dbe0092e79db /run.sh | |
| parent | 21a1f206ff3ed5b692362d439174a387aa0d1b0d (diff) | |
feat(run): update `.run` to 0.1.1
Diffstat (limited to 'run.sh')
| -rw-r--r-- | run.sh | 24 |
1 files changed, 20 insertions, 4 deletions
@@ -10,6 +10,8 @@ # You can go to [https://catilgrass.github.io/run] to install it # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +# Version: 0.1.1 + cd "$(dirname "$0")" || exit 1 declare -A tools @@ -89,11 +91,18 @@ done if [ $# -eq 0 ]; then sorted_names=($( for name in "${!tools[@]}"; do + first_char="${name:0:1}" + if [[ "$first_char" =~ [A-Z] ]]; then + case_pri="0" + else + case_pri="1" + fi if [ "${tools[$name]}" = "sh" ]; then - echo "0 $name" + lang_pri="0" else - echo "1 $name" + lang_pri="1" fi + echo "$case_pri$lang_pri $name" done | sort | while read -r _ n; do echo "$n"; done )) total=${#sorted_names[@]} @@ -149,11 +158,18 @@ shift if [[ "$target_name" =~ ^[0-9]+$ ]]; then sorted=($( for name in "${!tools[@]}"; do + first_char="${name:0:1}" + if [[ "$first_char" =~ [A-Z] ]]; then + case_pri="0" + else + case_pri="1" + fi if [ "${tools[$name]}" = "sh" ]; then - echo "0 $name" + lang_pri="0" else - echo "1 $name" + lang_pri="1" fi + echo "$case_pri$lang_pri $name" done | sort | while read -r _ n; do echo "$n"; done )) idx=$((target_name - 1)) |
