Bump check script
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
parent
5cec23d840
commit
b7d82e9262
1 changed files with 35 additions and 17 deletions
|
@ -8,29 +8,47 @@ then
|
|||
echo "The build file $entryFile does not exists"
|
||||
exit 2
|
||||
else
|
||||
backupFile="$entryFile.orig"
|
||||
path=$(dirname "$entryFile")
|
||||
file=$(basename $entryFile)
|
||||
|
||||
set -e
|
||||
cd $path
|
||||
echo "Entering $path"
|
||||
|
||||
# support for multiple chunks
|
||||
for chunk in *$file; do
|
||||
|
||||
# Backup original file
|
||||
echo "Backing up $entryFile to $backupFile"
|
||||
cp $entryFile $backupFile
|
||||
backupFile="$chunk.orig"
|
||||
echo "Backing up $chunk to $backupFile"
|
||||
cp $chunk $backupFile
|
||||
|
||||
done
|
||||
|
||||
# Make the app
|
||||
set -e
|
||||
cd "$path/../"
|
||||
make
|
||||
echo "Making $file"
|
||||
cd ../
|
||||
npm --silent install
|
||||
npm run --silent build
|
||||
|
||||
# Reset
|
||||
cd $root
|
||||
cd $path
|
||||
|
||||
# support for multiple chunks
|
||||
for chunk in *$file; do
|
||||
|
||||
# Compare build files
|
||||
echo "Comparing $entryFile to the original"
|
||||
if ! diff -q $entryFile $backupFile &>/dev/null
|
||||
echo "Comparing $chunk to the original"
|
||||
backupFile="$chunk.orig"
|
||||
if ! diff -q $chunk $backupFile &>/dev/null
|
||||
then
|
||||
echo "$entryFile build is NOT up-to-date! Please send the proper production build within the pull request"
|
||||
echo "$chunk build is NOT up-to-date! Please send the proper production build within the pull request"
|
||||
cat $HOME/.npm/_logs/*.log
|
||||
exit 2
|
||||
else
|
||||
echo "$entryFile build is up-to-date"
|
||||
echo "$chunk build is up-to-date"
|
||||
fi
|
||||
|
||||
done
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue