Skip to content

Instantly share code, notes, and snippets.

@Darep
Created January 24, 2020 11:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Darep/c75cb9737aa29e402f73957597f4cedb to your computer and use it in GitHub Desktop.
Save Darep/c75cb9737aa29e402f73957597f4cedb to your computer and use it in GitHub Desktop.
#!/bin/sh
#
# Diffs the bundles of a branch with master.
#
BRANCH=$1
# Don't build master if we already have it
if [ ! -d "build_master" ]; then
echo 'Building "master" branch bundle...'
git checkout master
echo 'Removing node_modules...'
rm -rf node_modules
yarn install -s
NO_MINIFY=1 yarn build
mv build build_master
fi
# Build the second bundle
echo "Building $BRANCH bundle..."
git checkout $BRANCH
echo 'Removing node_modules...'
rm -rf node_modules
yarn install -s
NO_MINIFY=1 yarn build
# Do the Diff
set -x
diff build/static/commons/main-*.js build_master/static/commons/main-*.js
diff build/bundles/pages/_app.js build_master/bundles/pages/_app.js
diff build/bundles/pages/_error.js build_master/bundles/pages/_error.js
diff build/bundles/pages/account.js build_master/bundles/pages/account.js
diff build/bundles/pages/activate.js build_master/bundles/pages/activate.js
diff build/bundles/pages/deploy.js build_master/bundles/pages/deploy.js
diff build/bundles/pages/forgot-password.js build_master/bundles/pages/forgot-password.js
diff build/bundles/pages/index.js build_master/bundles/pages/index.js
diff build/bundles/pages/login.js build_master/bundles/pages/login.js
diff build/bundles/pages/logout.js build_master/bundles/pages/logout.js
diff build/bundles/pages/networks.js build_master/bundles/pages/networks.js
diff build/bundles/pages/people.js build_master/bundles/pages/people.js
diff build/bundles/pages/people/create.js build_master/bundles/pages/people/create.js
diff build/bundles/pages/people/subaccount.js build_master/bundles/pages/people/subaccount.js
diff build/bundles/pages/private-cloud.js build_master/bundles/pages/private-cloud.js
diff build/bundles/pages/resetpass.js build_master/bundles/pages/resetpass.js
diff build/bundles/pages/server.js build_master/bundles/pages/server.js
diff build/bundles/pages/server/console.js build_master/bundles/pages/server/console.js
diff build/bundles/pages/storage.js build_master/bundles/pages/storage.js
diff build/bundles/pages/suspended.js build_master/bundles/pages/suspended.js
diff build/bundles/pages/usage.js build_master/bundles/pages/usage.js
echo "Done! Feel free to remove build and build_master if you no longer need them: rm -rf build build_master"
# Cleanup?
# rm -rf build build_master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment