Skip to content

Instantly share code, notes, and snippets.

@netologist
Forked from debedb/Go vendoring
Created August 19, 2016 13:52
Show Gist options
  • Save netologist/1e225b6d473ed3f9290f4b69e83788e2 to your computer and use it in GitHub Desktop.
Save netologist/1e225b6d473ed3f9290f4b69e83788e2 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