mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-01 20:28:16 +02:00
Allow for bun to be the executor and bring back the spinner
This commit is contained in:
@@ -29,19 +29,21 @@ fi
|
||||
node_bin="\$node_root/bin/node"
|
||||
npx_bin="\$node_root/bin/npx"
|
||||
|
||||
# Resolve the package bin inside npx, then run it with node@latest without leaking node@latest into PATH.
|
||||
# Resolve the package bin inside npx, then run it with node@latest available for node shebangs.
|
||||
# Some wrappers are aliases, e.g. playwright-cli wraps the playwright bin.
|
||||
"\$node_bin" "\$npx_bin" --yes --prefer-online --package "\$package" -- true
|
||||
|
||||
package_bin_path=\$("\$node_bin" "\$npx_bin" --yes --package "\$package" -- which "\$package" 2>/dev/null)
|
||||
|
||||
if [[ -n \$package_bin_path ]]; then
|
||||
exec "\$node_bin" "\$package_bin_path" "\$@"
|
||||
PATH="\$node_root/bin:\$PATH" exec "\$package_bin_path" "\$@"
|
||||
fi
|
||||
|
||||
# Scoped packages like @openai/codex expose an unscoped bin like codex.
|
||||
package_bin_path=\$("\$node_bin" "\$npx_bin" --yes --package "\$package" -- which "\$command" 2>/dev/null)
|
||||
|
||||
if [[ -n \$package_bin_path ]]; then
|
||||
exec "\$node_bin" "\$package_bin_path" "\$@"
|
||||
PATH="\$node_root/bin:\$PATH" exec "\$package_bin_path" "\$@"
|
||||
fi
|
||||
|
||||
echo "Could not resolve npm bin for \$package / \$command" >&2
|
||||
|
||||
Reference in New Issue
Block a user