setup-common.sh 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/bin/bash
  2. # Don't redownload facil.io unless using the FIO_EDGE flag.
  3. if [[ (! -d facil_app) || (-n "${FIO_EDGE}") ]] ; then
  4. # remove existing installation, if any
  5. if [ -e facil_app ] ; then
  6. rm -R facil_app
  7. fi
  8. # create new installation folder
  9. mkdir facil_app
  10. cd facil_app
  11. #### Download and unpack
  12. # Download source selection
  13. # Setting FIO_EDGE will test against the master branch on the development machine. i.e.:
  14. # $ FIO_EDGE=1 tfb --mode verify --test facil.io
  15. if [[ -z "${FIO_EDGE}" ]]; then
  16. echo "INFO: loading facil.io version 0.7.0.beta7"
  17. FIO_URL="https://api.github.com/repos/boazsegev/facil.io/tarball/0.7.0.beta7"
  18. else
  19. echo "INFO: development mode detected, loading facil.io from master."
  20. FIO_URL="https://github.com/boazsegev/facil.io/archive/master.tar.gz"
  21. fi
  22. # Download
  23. curl -s -o facil.io.tar.gz -LJO $FIO_URL
  24. # Unpack
  25. tar --strip-components=1 -xzf facil.io.tar.gz
  26. if [ $? -ne 0 ]; then echo "Couldn't extract tar."; exit 1; fi
  27. # Cleanup
  28. rm facil.io.tar.gz
  29. ./scripts/new/cleanup
  30. cd ..
  31. fi
  32. # remove any existing source files, such as boiler plate
  33. rm -R facil_app/src
  34. mkdir facil_app/src