main.sh 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/bin/bash
  2. script_folder=`dirname $0`
  3. foldername="$1"
  4. echo "maker folder $maker_folder"
  5. echo "folder name $foldername"
  6. create-react-app $foldername
  7. cd $foldername
  8. # add packages
  9. yarn add react-bootstrap \
  10. redux react-redux \
  11. react-router react-router-dom react-router-redux@next \
  12. rxjs redux-observable
  13. #TODO: integrate react-router routes https://medium.com/@notrab/getting-started-with-create-react-app-redux-react-router-redux-thunk-d6a19259f71f
  14. #TODO: integrate react-router-bootstrap https://github.com/react-bootstrap/react-router-bootstrap
  15. # add to .gitignore
  16. echo "" >> .gitignore
  17. echo "*.swp" >> .gitignore
  18. # add to package.json
  19. sed -i 's/"private": true/"private": true,\n "author": "Brandon Wong <projects@brwong.net> (https:\/\/www.brwong.net\/)"/g' package.json
  20. # add to index.html
  21. sed -i 's_ </head>_\n <!-- Bootstrap CSS -->\n <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/latest/css/bootstrap.min.css">\n <!-- Optional Bootstrap theme -->\n <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/latest/css/bootstrap-theme.min.css">\n </head>_' public/index.html
  22. # copy files
  23. cp $script_folder/epics.js $script_folder/index.js $script_folder/reducers.js $script_folder/store.js src/
  24. # initialize git
  25. git init .