Skip to content

Commit

Permalink
Add pre-commit plugin .js files compiling and building (software-mans…
Browse files Browse the repository at this point in the history
…ion#4326)

## Summary

If you forgor to build the plugin it will do it for you. But pls don't
forgor.

## Test plan

Forgor on purpose and see angry message.
  • Loading branch information
tjzel authored and fluiddot committed Jun 5, 2023
1 parent 6444971 commit 8a2de94
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,19 @@

yarn lint-staged
yarn type:check

# This automatically builds Reanimated Babel plugin JavaScript files if their
# TypeScript counterparts were changed. It also adds those files to the commit
# if those built files differ from currently committed ones.
! git diff-index HEAD --name-only |\
grep -E '^plugin/' > /dev/null
if [ $? -eq 1 ]; then
yarn plugin
! git status -u |\
grep -E 'plugin/build/plugin\.js|plugin/build/plugin\.js\.map' > /dev/null
if [ $? -eq 1 ]; then
git add plugin/build/plugin.js plugin/build/plugin.js.map
echo "[Reanimated] Plugin files were automatically built and changes were spotted.\
\n Those changes were added to the commit." >&2
fi
fi

0 comments on commit 8a2de94

Please sign in to comment.