Files
react/scripts/circleci/check_modules.sh
Dan Abramov f1c6488f1b Forbid adding new files with @providesModule (#11361)
* Forbid adding new files with @providesModule

* Turn off Haste mode in Flow config

* chmod a+x

* Try to fix bash

* Try to fix bash again
2017-10-25 19:50:34 +03:00

14 lines
367 B
Bash
Executable File

#!/bin/bash
set -e
# Make sure we don't introduce accidental @providesModule annotations.
EXPECTED='scripts/rollup/header.js'
ACTUAL=$(git grep -l @providesModule -- './*.js' ':!scripts/rollup/shims/*.js')
if [ "$EXPECTED" != "$ACTUAL" ]; then
echo "@providesModule crept into some new files?"
diff -u <(echo "$EXPECTED") <(echo "$ACTUAL") || true
exit 1
fi