diff --git a/package-lock.json b/package-lock.json index d94510b..9745c11 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@isupervillain/opencode-container-exec", - "version": "1.0.0-beta.0", + "version": "1.0.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@isupervillain/opencode-container-exec", - "version": "1.0.0-beta.0", + "version": "1.0.1", "cpu": [ "x64", "arm64" diff --git a/scripts/toggle.sh b/scripts/toggle.sh index 10b43f8..55cbdb2 100755 --- a/scripts/toggle.sh +++ b/scripts/toggle.sh @@ -325,8 +325,19 @@ select_container() { local id while IFS= read -r id; do - if [[ -n "$id" ]] && [[ ! " ${auto_containers[*]} " =~ " ${id} " ]]; then - auto_containers+=("$id") + if [[ -n "$id" ]]; then + local is_duplicate=false + local existing_id + for existing_id in "${auto_containers[@]}"; do + if [[ "$existing_id" == "$id" ]]; then + is_duplicate=true + break + fi + done + + if [[ "$is_duplicate" == false ]]; then + auto_containers+=("$id") + fi fi done <<< "$auto_container_lines" done < <(get_auto_detect_paths "$win_path")