Skip to content

Instantly share code, notes, and snippets.

@j0shua
Forked from netologist/Go vendoring
Created January 5, 2018 17:35
Show Gist options
  • Save j0shua/ba8f4ea93e9c9eb0f347769bf843219c to your computer and use it in GitHub Desktop.
Save j0shua/ba8f4ea93e9c9eb0f347769bf843219c to your computer and use it in GitHub Desktop.
#!/bin/sh
if [ "$1" == "" ]; then
echo "Usage: $0 <PROJECT_ROOT> <GITHUB_REPO>"
exit 1
fi
if [ "$2" == "" ]; then
echo "Usage: $0 <PROJECT_ROOT> <GITHUB_REPO>"
exit 1
fi
$branch=$3
if [ "$branch" == "" ]; then
branch=master
fi
cd $1
git submodule add https://github.com/${2}.git vendor/github.com/$2
cd vendor/github.com/$2
git checkout master
cd -
git add $2
git commit -m "Added github.com/$2"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment