Add import_map.json and use it for remote script execution

This commit is contained in:
Karolis2011 2025-11-29 23:28:40 +02:00
parent df5df0ea92
commit 8ae1d52f8c
2 changed files with 15 additions and 1 deletions

View file

@ -365,7 +365,14 @@ scripts() {
return 127;
fi
deno run --allow-all "$url" "$@";
local import_map_url
if [[ "$ref" == v* ]]; then
import_map_url="${BASE_RAW}/tag/$ref/import_map.json"
else
import_map_url="${BASE_RAW}/branch/$ref/import_map.json"
fi
deno run --allow-all --import-map="$import_map_url" "$url" "$@";
}
# --- Autocompletion ---------------------------------------------------