Skip to content

Commit

Permalink
Use base path from pnpm bin --global
Browse files Browse the repository at this point in the history
  • Loading branch information
karlhorky committed Oct 26, 2024
1 parent 11cdf37 commit d95eb6a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bin/preflight.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ tsx_shim="$script_dir/../node_modules/.bin/tsx"
exec_command=$(awk '/^else$/{flag=1;next}/^fi$/{flag=0}flag' "$tsx_shim" | grep 'exec node')
cli_path=$(echo "$exec_command" | sed -E 's/^[[:space:]]*exec node[[:space:]]+"([^"]+)".*/\1/')
cli_path="${cli_path/\$basedir/$script_dir}"
cli_path="${cli_path/\/pnpm\//\/pnpm\/global\/5\/.pnpm\/}"
pnpm_bin_global="$(pnpm bin --global)"
cli_path="${cli_path/\/$pnpm_bin_global\//\/$pnpm_bin_global\/global\/5\/.pnpm\/}"

if [[ ! -x "$cli_path" ]]; then
echo "Error: tsx executable not found or is not executable at $cli_path" >&2
Expand Down

0 comments on commit d95eb6a

Please sign in to comment.