I wrote a few BASH scripts to help in the Git and React World
All instructions are in the README
File 1 - Bash Aliases - to make your life easier...
Script 1 - setup-react.sh
- Asks for an app name and creates it in the current folder
- Installs react-router and react-router-dom
- Creates a file / folder structure:
configs/AppRouter.jsxconfigs/PrivateRoute.jsxcomponents/reuse/NavBar.jsxcomponents/pages/Header.jsxcomponents/pages/Footer.jsxpages/user/Home.jsxpages/user/Contact.jsxpages/user/About.jsx
- Writes the Routes for the pages and puts content into each of them
- Rewrites the App.js file to contain:
<Header /><AppRouter /><Footer />
- Rewrites index.js to wrap the App component in BrowserRouter
Script 2 - Git Create Branch
- Asks for branch name
- Creates a new branch
- Sets the upstream for the branch
Script 3 -- Git Deploy
- Asks for a Commit message
- Adds files
- Commits files with commit message
- Pushes files to current branch as long as the upstream is set
Script 4 - Clean Node Modules
- Digs down deep to remove node modules folders
Top comments (0)