Skip to content

Instantly share code, notes, and snippets.

@pirey
Created April 18, 2020 12:39
Show Gist options
  • Select an option

  • Save pirey/6dffd2e00cf50ce1ae7c37c6882e8aa6 to your computer and use it in GitHub Desktop.

Select an option

Save pirey/6dffd2e00cf50ce1ae7c37c6882e8aa6 to your computer and use it in GitHub Desktop.
Script to build react app as archive
#!/bin/sh
CURRENT_TAG=$(git tag --points-at HEAD)
CURRENT_DATE=$(date +%Y-%m-%d_%H%M%S)
rm -rf ./build
npm run build
mkdir -p dist
cd build && tar -zcvf ../dist/build-${CURRENT_TAG}-${CURRENT_DATE}.tar.gz . && cd -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment