Created
July 4, 2020 07:38
-
-
Save luvuong-le/71f431dbe59779919877764ea871d6c0 to your computer and use it in GitHub Desktop.
Copy a specific folder to specified location. Eg - Basic HTML,CSS,JS folder to generate fast
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This could be a folder that has a basic HTML, CSS, JS setup | |
TEMPLATE_PATH="<path/to/templatefolder>" | |
function createTemplate() { | |
echo "Beginning Template Creation..." | |
# Navigate into the new directory | |
cd "${1}" | |
# Copy all files from template folder into the new folder | |
cp -r "${TEMPLATE_PATH}\." "${PWD}" | |
echo "Template Successfully Created." | |
} | |
# Create a new directory from the current directory into the new folder defined by user | |
if [ -d "${PWD}/$1" ]; then | |
echo "Folder Already Exists... Skipping" | |
else | |
echo "Creating Project Folder..." | |
mkdir "${PWD}/$1" | |
fi | |
# Create the directory | |
createTemplate "${PWD}/${1}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment