From edd122f312930e79589d0337cf5b33c2db67b180 Mon Sep 17 00:00:00 2001 From: patrick brisbin Date: Fri, 6 Dec 2024 07:28:44 -0500 Subject: [PATCH] [prettier] make shim executable more robust --- prettier/install.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/prettier/install.sh b/prettier/install.sh index 7ba03d7a..024c4742 100755 --- a/prettier/install.sh +++ b/prettier/install.sh @@ -12,8 +12,15 @@ done cat >/usr/local/bin/prettier </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