diff options
author | Ben Sima <ben@bsima.me> | 2018-06-27 08:04:54 -0700 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2018-06-27 08:04:54 -0700 |
commit | 6c2295394ece45edd5b3012a98f8aed62c66d7a5 (patch) | |
tree | f3d1ea1d917c93bd8650fac9e55b349a0de16284 /workon | |
parent | 775b30ea7c076d0cccec695e8498277133ed3429 (diff) |
WIP scripts
Diffstat (limited to 'workon')
-rwxr-xr-x | workon | 42 |
1 files changed, 20 insertions, 22 deletions
@@ -6,29 +6,27 @@ # Original author: https://github.com/sumitsu GITHUB_USER=bsima -GITHUB_WORK=LiaisonTechnologies -DESK="${HOME}/desk" # or wherever you typically put your code +GITHUB_WORK=${2:-LiaisonTechnologies} +DESK="${HOME}/work/${GITHUB_WORK}/" # or wherever you typically put your code -for REPO in "$@" -do - echo "${REPO}"; - if [ ! -d "${DESK}/${REPO}" ] +echo "${REPO}" +if [ ! -d "${DESK}/${REPO}" ] +then + if ( ! git clone git@github.com:${GITHUB_USER}/${REPO}.git ${DESK}/${REPO} ) then - if ( ! git clone git@github.com:${GITHUB_USER}/${REPO}.git ${DESK}/${REPO} ) - then - echo "FAILED"; - exit 1; - fi; - else - echo "(already exists)"; - exit 1; - fi; - cd "${DESK}/${REPO}"; - git remote add upstream git@github.com:${GITHUB_WORK}/${REPO}.git; - git config branch.master.remote upstream - git config branch.master.merge refs/heads/master - git config remote.pushDefault origin - git remote -v; -done; + echo "FAILED" + exit 1 + fi +else + echo "(already exists)" + cd "${DESK}/${REPO}" + exit 1 +fi; +cd "${DESK}/${REPO}" +git remote add upstream git@github.com:${GITHUB_WORK}/${REPO}.git +git config branch.master.remote upstream +git config branch.master.merge refs/heads/master +git config remote.pushDefault origin +git remote -v exit 0; |