Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. # Shebang - Tells Unix the file is executed by bin/bash
  2. #!/bin/bash
  3.  
  4. # Template path with your project setup
  5. TEMPLATE_PATH="YOUR_PROJECT_PATH"
  6.  
  7. function createTemplate() {
  8. echo "Beginning Template Creation..."
  9.  
  10. # Navigate into the new directory
  11. cd "${1}"
  12.  
  13. # Copy all files from template folder into the new folder
  14. cp -r "${TEMPLATE_PATH}\." "${PWD}"
  15.  
  16. echo "Template Successfully Created."
  17. }
  18.  
  19. # Create a new directory from the current directory into the new folder defined by user
  20.  
  21. if [ -d "${PWD}/$1" ]; then
  22. echo "Folder Already Exists... Skipping"
  23. else
  24. echo "Creating Project Folder..."
  25. mkdir "${PWD}/$1"
  26. fi
  27.  
  28. # Create the directory
  29. createTemplate "${PWD}/${1}"
  30.  
  31. # Prevent Shell From Closing If Needed
  32. # $SHELL
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement