oasis_test_v2 2.2.13 → 2.2.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -53,6 +53,21 @@ oasis_resolve_bin() {
53
53
  return 0
54
54
  fi
55
55
  done <<< "$(echo "$PATH" | tr ':' '\n')"
56
+
57
+ # 最后一档:被「挪开遮挡」挪走的那个原件(<cmd>.oasis-displaced)。
58
+ #
59
+ # 为什么非有不可:clearLoginShellShadow() 会把 $HOME/.local/bin/<cmd> 改名挪走
60
+ # (理由见那个函数的注释)。如果这台机器上**真实 CLI 只有那一份**——没装到
61
+ # ~/.oasis/connector-tools/bin——那么上面按 <cmd> 扫 PATH 会一个都找不到,
62
+ # 挪走遮挡反而把 CLI 弄没了。改名而不是删除,就是为了这一档能把它捡回来。
63
+ while IFS= read -r dir; do
64
+ candidate="$dir/$cmd_name.oasis-displaced"
65
+ if [ -x "$candidate" ] && [ "$(realpath "$candidate" 2>/dev/null)" != "$SELF" ]; then
66
+ printf -v "$bin_var" '%s' "$candidate"
67
+ export "$bin_var"
68
+ return 0
69
+ fi
70
+ done <<< "$(echo "$PATH" | tr ':' '\n')"
56
71
  }
57
72
 
58
73
  # Check that the resolved binary is accessible and responds to --version.