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