2018-06-06 19:02:43 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
root=$(pwd)
|
2018-06-07 09:35:00 +03:00
|
|
|
entryFile=$1
|
2018-06-06 19:02:43 +03:00
|
|
|
|
2018-06-07 09:35:00 +03:00
|
|
|
if [ ! -f "$entryFile" ]
|
|
|
|
then
|
|
|
|
echo "The build file $entryFile does not exists"
|
|
|
|
exit 2
|
|
|
|
else
|
2018-06-06 19:02:43 +03:00
|
|
|
backupFile="$entryFile.orig"
|
|
|
|
path=$(dirname "$entryFile")
|
|
|
|
|
|
|
|
# Backup original file
|
|
|
|
echo "Backing up $entryFile to $backupFile"
|
|
|
|
cp $entryFile $backupFile
|
|
|
|
|
|
|
|
# Make the app
|
2018-06-06 20:22:35 +03:00
|
|
|
set -e
|
2018-06-06 19:02:43 +03:00
|
|
|
cd "$path/../"
|
|
|
|
make
|
|
|
|
|
|
|
|
# Reset
|
|
|
|
cd $root
|
|
|
|
|
|
|
|
# Compare build files
|
|
|
|
echo "Comparing $entryFile to the original"
|
|
|
|
if ! diff -q $entryFile $backupFile &>/dev/null
|
|
|
|
then
|
|
|
|
echo "$entryFile build is NOT up-to-date! Please send the proper production build within the pull request"
|
2018-06-06 20:22:35 +03:00
|
|
|
cat $HOME/.npm/_logs/*.log
|
2018-06-06 19:02:43 +03:00
|
|
|
exit 2
|
|
|
|
else
|
|
|
|
echo "$entryFile build is up-to-date"
|
|
|
|
fi
|
2018-06-07 09:35:00 +03:00
|
|
|
fi
|