Last active
May 12, 2022 14:37
-
-
Save Charlie-robin/a92d1d6164458049ebdadfa45f15486f to your computer and use it in GitHub Desktop.
Clone a students repo, change branch create folder and .md file. Install any dependencies
This file contains hidden or 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 | |
# Enter Github url + Student's name / Name of the folder it is going to create for you. | |
# Clone a students repo, change branch to feedback. | |
# It will create a feedback folder in the project. | |
# If there is a template.md and it will copy and rename it in the feedback folder. | |
# Else it will create a blank notes.md in the feedback folder. | |
# If the project has a package.json it will install any dependencies listed. | |
echo "Enter the GitHub URL " | |
read github_url | |
echo "Enter the Student's name " | |
read student | |
git clone $github_url $student | |
cd $student | |
git checkout -b feedback | |
mkdir feedback | |
if [[ -f "../template.md" ]]; then | |
echo "Found template.md" | |
cp ../template.md feedback/notes.md | |
else | |
touch feedback/notes.md | |
fi | |
message="You are now on the feedback branch, Feedback folder & notes.md have been created." | |
if [[ -f "./package.json" ]]; then | |
echo "Found package.json" | |
npm install | |
message="${message} Dependancies have been installed." | |
fi | |
echo ${message} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment