Created
August 8, 2020 10:45
-
-
Save tacitphoenix/ee4a48e51c7ba6d5a5d91783c9568b0d to your computer and use it in GitHub Desktop.
A script to add example repos to a companion practice repo
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 | |
BOOK_REPO=<git url to example repo> | |
EXCODE=temp/example_code | |
# make top-level temp directory | |
mkdir -p ../$EXCODE | |
# add top-level temp directory to gitignore | |
if ! grep -q $EXCODE ../.gitignore; then | |
echo "${EXCODE}/" >> ../.gitignore | |
fi | |
# clone book example repo to temp directory | |
git clone $BOOK_REPO ../$EXCODE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment