Skip to content

Commit

Permalink
[prettier] flip the name we install vs the copy
Browse files Browse the repository at this point in the history
  • Loading branch information
pbrisbin committed Dec 6, 2024
1 parent 3a99094 commit ebcb68a
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions prettier/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,14 @@ for plugin in "${plugins[@]}"; do
(cd /app/node_modules/"$plugin" && yarn link)
done

cat >/usr/local/bin/prettier-with-tailwindcss <<EOM
cat >/usr/local/bin/prettier <<EOM
#!/usr/bin/env bash
#
# NB. this executable handles link/unlink of all plugins, not just tailwind, but
# we're keeping it named as is to avoid errors for users who may be using
# command in their .restyled.yaml
#
###
yarn --offline link ${plugins[*]} >/dev/null
trap 'yarn --offline unlink ${plugins[*]} >/dev/null' EXIT
/app/node_modules/.bin/prettier "\$@"
EOM

# Install at the legacy name we may see as CMD in the wild
chmod +x /usr/local/bin/prettier-with-tailwindcss
chmod +x /usr/local/bin/prettier

# Copy back as the right name
cp /usr/local/bin/prettier{-with-tailwindcss,}
# Copy as a legacy name we may see as CMD in the wild
cp /usr/local/bin/prettier{,-with-tailwindcss}

0 comments on commit ebcb68a

Please sign in to comment.