Last active
February 10, 2017 20:01
Revisions
-
debedb revised this gist
Feb 10, 2017 . 1 changed file with 35 additions and 10 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,23 +1,48 @@ #!/bin/sh set -x if [ "$1" == "" ]; then echo "Usage: $0 <REPO_PATH> [<PROJECT_ROOT>] [<branch>]" exit 1 fi repo=$1 # Check if repo is relative path=$(echo $repo | cut -d/ -f3) if [ "$path" == "" ]; then host="github.com" path=$repo else host=$(echo $repo | cut -d/ -f1) path=$(echo $repo | cut -d/ -f2,3) fi project_root=$2 if [ "$project_root" == "" ]; then project_root=`pwd` echo "Set project root to cwd: ${project_root}" fi git_dir="$project_root/.git" if ! [ -d $git_dir ]; then echo "$project_root is not a Git repo: $git_dir not found." exit 1 fi branch=$3 if [ "$branch" == "" ]; then branch=master fi cd $project_root git submodule add --force https://$host/${path}.git vendor/$host/$path cd vendor/$host/$path git checkout $branch cd - git add vendor/$host/$path git commit -m "Added $host/$repo" git submodule update --init -f -
debedb revised this gist
Oct 2, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -16,7 +16,7 @@ fi cd $1 git submodule add https://github.com/${2}.git vendor/github.com/$2 cd vendor/github.com/$2 git checkout $branch cd - git add $2 git commit -m "Added github.com/$2" -
debedb revised this gist
Mar 14, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -14,7 +14,7 @@ if [ "$branch" == "" ]; then fi cd $1 git submodule add https://github.com/${2}.git vendor/github.com/$2 cd vendor/github.com/$2 git checkout master cd - -
debedb created this gist
Oct 19, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ #!/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 [email protected]:${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"