main.sh 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. # disable auto-open browser
  16. sed -i 's_openBrowser(_//openBrowser(_g' node_modules/react-scripts/scripts/start.js
  17. # add to .gitignore
  18. echo "" >> .gitignore
  19. echo "*.swp" >> .gitignore
  20. # add to package.json
  21. sed -i 's/"private": true/"private": true,\n "author": "Brandon Wong <wong.brandon@rcgt.com> (https:\/\/www.catallaxy.com\/)"/g' package.json
  22. # add to index.html
  23. 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
  24. # copy files
  25. cp $script_folder/App.js $script_folder/epics.js $script_folder/index.js $script_folder/reducers.js $script_folder/store.js src/
  26. # initialize git
  27. git init .