Fix paths for bin tools and scoped tools [skip ci]

This commit is contained in:
Shivam Mathur
2026-01-23 01:04:38 +05:30
parent 341bc9e176
commit 1eee54fe48
3 changed files with 17 additions and 7 deletions

View File

@@ -176,10 +176,14 @@ add_tool() {
if ! [ -d "$tool_path_dir" ]; then
sudo mkdir -p "$tool_path_dir"
fi
add_path "$tool_path_dir"
if ! [ -d "$tool_cache_path_dir" ]; then
sudo mkdir -p "$tool_cache_path_dir"
fi
add_path "$tool_path_dir" verify
add_path "$tool_cache_path_dir"
IFS="," read -r -a url <<<"$url"
cache_key=$(get_sha256 "${url[0]}" | head -c 16)
cache_path="/tmp/${tool}-${cache_key}"
cache_path="$tool_cache_path_dir/${tool}-${cache_key}"
status_code="200"
if [ -f "$cache_path" ]; then
sudo cp -a "$cache_path" "$tool_path"
@@ -199,6 +203,7 @@ add_tool() {
fi
if [ "$status_code" = "200" ]; then
add_tools_helper "$tool"
[ -L "$tool_cache_path_dir/$tool" ] || sudo ln -s "$tool_path" "$tool_cache_path_dir/$tool" 2>/dev/null || true
tool_version=$(get_tool_version "$tool" "$ver_param")
add_log "${tick:?}" "$tool" "Added $tool $tool_version"
else