Skip to content

Commit

Permalink
[prettier] make shim executable more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
pbrisbin committed Dec 6, 2024
1 parent ebcb68a commit edd122f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions prettier/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,15 @@ done

cat >/usr/local/bin/prettier <<EOM
#!/usr/bin/env bash
yarn --offline link ${plugins[*]} >/dev/null
trap 'yarn --offline unlink ${plugins[*]} >/dev/null' EXIT
if ! yarn --offline link ${plugins[*]} >/dev/null; then
echo "Failed to link yarn modules" >&2
echo "Please report this as an issue" >&2
echo "https://github.com/restyled-io/restylers/issues" >&2
exit 1
fi
trap 'yarn --offline unlink ${plugins[*]} >/dev/null || true' EXIT
/app/node_modules/.bin/prettier "\$@"
EOM

Expand Down

0 comments on commit edd122f

Please sign in to comment.