Skip to content

Instantly share code, notes, and snippets.

@puilp0502
Last active September 2, 2020 17:13
Show Gist options
  • Save puilp0502/42c716ba9e4fe9aa5e44ee9b15effe79 to your computer and use it in GitHub Desktop.
Save puilp0502/42c716ba9e4fe9aa5e44ee9b15effe79 to your computer and use it in GitHub Desktop.
Initialize new react-ts-boilerplate template
#!/bin/sh
REPO_URI="https://github.com/puilp0502/react-ts-boilerplate"
mkdir "$1" 2> /dev/null
VALID_DIRNAME=$?
if [ 0 -eq $VALID_DIRNAME ]; then
rmdir "$1"
else
echo "Invalid target directory: " "$1"
exit 1
fi
# Clone Repo
git clone "$REPO_URI" "$1"
# Re-initialize git repo
cd "$1" && rm -rf .git && git init
# Install dependencies
npm install
echo "\nDone."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment