Skip to content

Instantly share code, notes, and snippets.

@masterxavierfox
Forked from hosamshahin/github.sh
Created September 3, 2019 07:43
Show Gist options
  • Select an option

  • Save masterxavierfox/36aaafa2118916030171722b7af7aa9d to your computer and use it in GitHub Desktop.

Select an option

Save masterxavierfox/36aaafa2118916030171722b7af7aa9d to your computer and use it in GitHub Desktop.

Revisions

  1. @hosamshahin hosamshahin revised this gist Sep 22, 2016. 1 changed file with 7 additions and 4 deletions.
    11 changes: 7 additions & 4 deletions github.sh
    Original file line number Diff line number Diff line change
    @@ -19,16 +19,17 @@ function main {
    detect_user

    # Missing arguments
    args=$1
    if [ -z $args ]; then
    args=$@
    arg1=$1
    if [ -z $arg1 ]; then
    echo '
    gh: try ''`gh --help`'' for more information
    '
    exit
    fi

    # Display help text
    if [ $args = '--help' ]; then
    if [ $arg1 = '--help' ]; then
    echo '
    Clone repos from your GitHub
    gh repo1 repo2
    @@ -64,6 +65,8 @@ function detect_user {

    function find_repos {
    for repo in $args; do
    echo 'in find_repos for'
    echo ''
    # If a user provides the parameter username/repo pull in that specific repository.
    if [ `awk -v repo="$repo" -v delimit="/" 'BEGIN{print index(repo,delimit)}'` -ne 0 ]; then
    echo "Pulling in $repo";
    @@ -77,4 +80,4 @@ function find_repos {
    done
    }

    main $*
    main $@
  2. @hosamshahin hosamshahin revised this gist Sep 22, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion github.sh
    Original file line number Diff line number Diff line change
    @@ -19,7 +19,7 @@ function main {
    detect_user

    # Missing arguments
    # args=$1
    args=$1
    if [ -z $args ]; then
    echo '
    gh: try ''`gh --help`'' for more information
  3. @hosamshahin hosamshahin revised this gist Sep 22, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion github.sh
    Original file line number Diff line number Diff line change
    @@ -19,7 +19,7 @@ function main {
    detect_user

    # Missing arguments
    args=$1
    # args=$1
    if [ -z $args ]; then
    echo '
    gh: try ''`gh --help`'' for more information
  4. @hosamshahin hosamshahin revised this gist Sep 22, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion github.sh
    Original file line number Diff line number Diff line change
    @@ -67,7 +67,7 @@ function find_repos {
    # If a user provides the parameter username/repo pull in that specific repository.
    if [ `awk -v repo="$repo" -v delimit="/" 'BEGIN{print index(repo,delimit)}'` -ne 0 ]; then
    echo "Pulling in $repo";
    git clone --depth=1 $GITHUB_PREFIX$repo.git || echo "error happened in $repo"; true;
    git clone --depth=1 $GITHUB_PREFIX$repo.git || true

    # Default to you.
    else
  5. @hosamshahin hosamshahin revised this gist Sep 22, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion github.sh
    Original file line number Diff line number Diff line change
    @@ -67,7 +67,7 @@ function find_repos {
    # If a user provides the parameter username/repo pull in that specific repository.
    if [ `awk -v repo="$repo" -v delimit="/" 'BEGIN{print index(repo,delimit)}'` -ne 0 ]; then
    echo "Pulling in $repo";
    git clone --depth=1 $GITHUB_PREFIX$repo.git || echo "error happened in $repo"
    git clone --depth=1 $GITHUB_PREFIX$repo.git || echo "error happened in $repo"; true;

    # Default to you.
    else
  6. @hosamshahin hosamshahin revised this gist Sep 22, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion github.sh
    Original file line number Diff line number Diff line change
    @@ -67,7 +67,7 @@ function find_repos {
    # If a user provides the parameter username/repo pull in that specific repository.
    if [ `awk -v repo="$repo" -v delimit="/" 'BEGIN{print index(repo,delimit)}'` -ne 0 ]; then
    echo "Pulling in $repo";
    git clone --depth=1 $GITHUB_PREFIX$repo.git
    git clone --depth=1 $GITHUB_PREFIX$repo.git || echo "error happened in $repo"

    # Default to you.
    else
  7. @hosamshahin hosamshahin revised this gist Sep 22, 2016. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions github.sh
    Original file line number Diff line number Diff line change
    @@ -67,12 +67,12 @@ function find_repos {
    # If a user provides the parameter username/repo pull in that specific repository.
    if [ `awk -v repo="$repo" -v delimit="/" 'BEGIN{print index(repo,delimit)}'` -ne 0 ]; then
    echo "Pulling in $repo";
    git clone $GITHUB_PREFIX$repo.git
    git clone --depth=1 $GITHUB_PREFIX$repo.git

    # Default to you.
    else
    echo "Pulling in $USERNAME/$repo";
    git clone $GITHUB_PREFIX$USERNAME/$repo.git
    git clone --depth=1 $GITHUB_PREFIX$USERNAME/$repo.git
    fi
    done
    }
  8. @hosamshahin hosamshahin revised this gist Sep 22, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion github.sh
    Original file line number Diff line number Diff line change
    @@ -11,7 +11,7 @@
    #

    # Internal properties
    GITHUB_PREFIX=https://github.com:
    GITHUB_PREFIX=https://github.com/
    GITHUB_USERNAME=$(git config --global github.user)

    function main {
  9. @hosamshahin hosamshahin revised this gist Sep 22, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion github.sh
    Original file line number Diff line number Diff line change
    @@ -11,7 +11,7 @@
    #

    # Internal properties
    GITHUB_PREFIX=git@github.com:
    GITHUB_PREFIX=https://github.com:
    GITHUB_USERNAME=$(git config --global github.user)

    function main {
  10. @hosamshahin hosamshahin revised this gist Sep 22, 2016. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions github.sh
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@
    # Copyright 2011, Tim Branyen @tbranyen <[email protected]>
    # Dual licensed under the MIT and GPL licenses.
    #
    # Automatically clone single or multiple repos into a folder,
    # Automatically clone single or multiple repos into a folder,
    # great for setting up a git projects folder.
    #
    # Install: curl https://gist.github.com/raw/902154/github.sh > /usr/local/bin/gh
    @@ -32,7 +32,7 @@ function main {
    echo '
    Clone repos from your GitHub
    gh repo1 repo2
    Clone repos from others GitHub
    gh username/repo1 username/repo2
  11. @tbranyen tbranyen revised this gist Apr 14, 2011. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions github.sh
    Original file line number Diff line number Diff line change
    @@ -6,8 +6,8 @@
    # Automatically clone single or multiple repos into a folder,
    # great for setting up a git projects folder.
    #
    # Install: curl https://gist.github.com/raw/902154/github.sh > /usr/local/gh
    # chmod +x /usr/local/gh
    # Install: curl https://gist.github.com/raw/902154/github.sh > /usr/local/bin/gh
    # chmod +x /usr/local/bin/gh
    #

    # Internal properties
  12. @tbranyen tbranyen revised this gist Apr 14, 2011. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion github.sh
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,8 @@
    # Automatically clone single or multiple repos into a folder,
    # great for setting up a git projects folder.
    #
    # Install: curl http://t.no.de/gist/github.sh | sh
    # Install: curl https://gist.github.com/raw/902154/github.sh > /usr/local/gh
    # chmod +x /usr/local/gh
    #

    # Internal properties
  13. @tbranyen tbranyen revised this gist Apr 13, 2011. 1 changed file with 52 additions and 43 deletions.
    95 changes: 52 additions & 43 deletions github.sh
    Original file line number Diff line number Diff line change
    @@ -3,68 +3,77 @@
    # Copyright 2011, Tim Branyen @tbranyen <[email protected]>
    # Dual licensed under the MIT and GPL licenses.
    #
    # github.sh : Automatically clone single or multiple repos into
    # a folder, great for setting up a git projects folder.
    # Automatically clone single or multiple repos into a folder,
    # great for setting up a git projects folder.
    #
    # INSTALL:
    # Download to a directory in your path, /usr/local/bin or such;
    # you may want to rename to gh for easy access.
    # Set executable permissions `chmod +x gh`
    # Install: curl http://t.no.de/gist/github.sh | sh
    #
    # CONFIGURATION:
    # Set the USERNAME variable below, alternatively:
    # git config --global github.user username
    #
    # USAGE:
    # To pull repos from your GitHub
    # gh repo1 repo2 repo3
    #
    # To pull repos from others GitHub
    # gh username/repo1 username/repo2
    #
    # To handle multiple repos from a file, create a file named repos.txt
    # with repos line by line. Then feed it into this program with:
    # cat repos.txt | xargs gh
    #
    # TODO:
    # * Wrap usage in a heredoc to display when no arguments are provided.
    #
    # vim: ts=2:sw=2:sts=2
    #
    #
    # Override these with your own values
    USERNAME=

    # Internal properties
    [email protected]:
    GITHUB_USERNAME=$(git config --global github.user)

    # All arguments
    args=$*
    function main {
    # Improperly configured user
    detect_user

    # Missing arguments
    args=$1
    if [ -z $args ]; then
    echo '
    gh: try ''`gh --help`'' for more information
    '
    exit
    fi

    # Display help text
    if [ $args = '--help' ]; then
    echo '
    Clone repos from your GitHub
    gh repo1 repo2
    Clone repos from others GitHub
    gh username/repo1 username/repo2
    # Find each repo and pull from github
    for repo in $args; do
    Clone mixed repos:
    gh repo1 username/repo2
    Clone line separated repos from file:
    cat file | xargs gh
    '
    exit
    fi

    # Parse arguments and clone repos.
    find_repos
    }

    function detect_user {
    # If no username configured, attempt to pull from git --config
    if [ -z "$USERNAME" -a -n "$GITHUB_USERNAME" ]; then
    if [ -n "$GITHUB_USERNAME" ]; then
    USERNAME=$GITHUB_USERNAME
    else
    echo '
    gh: missing username
    configure username with ''`git config --global github.user username`''
    '
    exit
    fi
    }

    # Test for username
    if [ -n "$USERNAME" ]; then
    function find_repos {
    for repo in $args; do
    # If a user provides the parameter username/repo pull in that specific repository.
    if [ `awk -v repo="$repo" -v delimit="/" 'BEGIN{print index(repo,delimit)}'` -ne 0 ]; then
    echo "Pulling in $repo";
    git clone $GITHUB_PREFIX$repo.git

    # Use the default user specified.
    # Default to you.
    else
    echo "Pulling in $USERNAME/$repo";
    git clone $GITHUB_PREFIX$USERNAME/$repo.git
    fi
    done
    }

    # If no $USERNAME then issue warning
    else
    echo "Please configure either this script or 'git --config github.user username'"
    fi

    done
    main $*
  14. @tbranyen tbranyen revised this gist Apr 13, 2011. 1 changed file with 10 additions and 7 deletions.
    17 changes: 10 additions & 7 deletions github.sh
    Original file line number Diff line number Diff line change
    @@ -7,21 +7,24 @@
    # a folder, great for setting up a git projects folder.
    #
    # INSTALL:
    # curl
    # Download to a directory in your path, /usr/local/bin or such;
    # you may want to rename to gh for easy access.
    # Set executable permissions `chmod +x gh`
    #
    # CONFIGURATION:
    # Set the USERNAME variable below, alternatively:
    # git config --global github.user username.
    # git config --global github.user username
    #
    # Set executable permissions on this script:
    # chmod +x github.sh.
    #
    # USAGE:
    # To pull repos from your GitHub
    # ./github repo1 repo2 repo3
    # gh repo1 repo2 repo3
    #
    # To pull repos from others GitHub
    # ./github username/repo1 username/repo2
    # gh username/repo1 username/repo2
    #
    # To handle multiple repos from a file, create a file named repos.txt
    # with repos line by line. Then feed it into this program with:
    # cat repos.txt | xargs gh
    #
    # TODO:
    # * Wrap usage in a heredoc to display when no arguments are provided.
  15. @tbranyen tbranyen revised this gist Apr 12, 2011. 1 changed file with 5 additions and 4 deletions.
    9 changes: 5 additions & 4 deletions github.sh
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,8 @@
    # github.sh : Automatically clone single or multiple repos into
    # a folder, great for setting up a git projects folder.
    #
    #
    # INSTALL:
    # curl
    #
    # CONFIGURATION:
    # Set the USERNAME variable below, alternatively:
    @@ -17,13 +18,13 @@
    #
    # USAGE:
    # To pull repos from your GitHub
    # ./github.sh repo1 repo2 repo3
    # ./github repo1 repo2 repo3
    #
    # To pull repos from others GitHub
    # ./github.sh username/repo1 username/repo2
    # ./github username/repo1 username/repo2
    #
    # TODO:
    # * Nothing atm, features welcome
    # * Wrap usage in a heredoc to display when no arguments are provided.
    #
    # vim: ts=2:sw=2:sts=2
    #
  16. @tbranyen tbranyen revised this gist Apr 12, 2011. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion github.sh
    Original file line number Diff line number Diff line change
    @@ -6,6 +6,8 @@
    # github.sh : Automatically clone single or multiple repos into
    # a folder, great for setting up a git projects folder.
    #
    #
    #
    # CONFIGURATION:
    # Set the USERNAME variable below, alternatively:
    # git config --global github.user username.
    @@ -47,7 +49,7 @@ for repo in $args; do
    if [ -n "$USERNAME" ]; then
    # If a user provides the parameter username/repo pull in that specific repository.
    if [ `awk -v repo="$repo" -v delimit="/" 'BEGIN{print index(repo,delimit)}'` -ne 0 ]; then
    echo "Pulling in lol $repo";
    echo "Pulling in $repo";
    git clone $GITHUB_PREFIX$repo.git

    # Use the default user specified.
  17. @tbranyen tbranyen revised this gist Apr 12, 2011. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions github.sh
    Original file line number Diff line number Diff line change
    @@ -15,10 +15,10 @@
    #
    # USAGE:
    # To pull repos from your GitHub
    # ./github repo1 repo2 repo3
    # ./github.sh repo1 repo2 repo3
    #
    # To pull repos from others GitHub
    # ./github username/repo1 username/repo2
    # ./github.sh username/repo1 username/repo2
    #
    # TODO:
    # * Nothing atm, features welcome
  18. @tbranyen tbranyen revised this gist Apr 12, 2011. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions github.sh
    Original file line number Diff line number Diff line change
    @@ -3,8 +3,8 @@
    # Copyright 2011, Tim Branyen @tbranyen <[email protected]>
    # Dual licensed under the MIT and GPL licenses.
    #
    # github.sh : Automatically clone multiple repos into a folder,
    # great for setting up a git projects folder.
    # github.sh : Automatically clone single or multiple repos into
    # a folder, great for setting up a git projects folder.
    #
    # CONFIGURATION:
    # Set the USERNAME variable below, alternatively:
  19. @tbranyen tbranyen revised this gist Apr 12, 2011. 1 changed file with 7 additions and 3 deletions.
    10 changes: 7 additions & 3 deletions github.sh
    Original file line number Diff line number Diff line change
    @@ -6,10 +6,14 @@
    # github.sh : Automatically clone multiple repos into a folder,
    # great for setting up a git projects folder.
    #
    # Configuration:
    # Configure the USERNAME variable. chmod +x github.sh.
    # CONFIGURATION:
    # Set the USERNAME variable below, alternatively:
    # git config --global github.user username.
    #
    # Set executable permissions on this script:
    # chmod +x github.sh.
    #
    # Usage:
    # USAGE:
    # To pull repos from your GitHub
    # ./github repo1 repo2 repo3
    #
  20. @tbranyen tbranyen revised this gist Apr 12, 2011. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions github.sh
    Original file line number Diff line number Diff line change
    @@ -17,8 +17,7 @@
    # ./github username/repo1 username/repo2
    #
    # TODO:
    # * Error checking and fallbacks
    # * Automatically pull github username from GIT
    # * Nothing atm, features welcome
    #
    # vim: ts=2:sw=2:sts=2
    #
  21. @tbranyen tbranyen revised this gist Apr 12, 2011. 1 changed file with 15 additions and 10 deletions.
    25 changes: 15 additions & 10 deletions github.sh
    Original file line number Diff line number Diff line change
    @@ -38,19 +38,24 @@ for repo in $args; do
    # If no username configured, attempt to pull from git --config
    if [ -z "$USERNAME" -a -n "$GITHUB_USERNAME" ]; then
    USERNAME=$GITHUB_USERNAME
    elif [ -z "$USERNAME" -a -n "$GITHUB_USERNAME" ]; then
    echo "Please configure either this script or set: \n\
    git --config github.user username"
    fi

    # If a user provides the parameter username/repo pull in that specific repository.
    if [ `awk -v repo="$repo" -v delimit="/" 'BEGIN{print index(repo,delimit)}'` -ne 0 ]; then
    echo "Pulling in lol $repo";
    git clone $GITHUB_PREFIX$repo.git
    # Test for username
    if [ -n "$USERNAME" ]; then
    # If a user provides the parameter username/repo pull in that specific repository.
    if [ `awk -v repo="$repo" -v delimit="/" 'BEGIN{print index(repo,delimit)}'` -ne 0 ]; then
    echo "Pulling in lol $repo";
    git clone $GITHUB_PREFIX$repo.git

    # Use the default user specified.
    # Use the default user specified.
    else
    echo "Pulling in $USERNAME/$repo";
    git clone $GITHUB_PREFIX$USERNAME/$repo.git
    fi

    # If no $USERNAME then issue warning
    else
    echo "Pulling in $USERNAME/$repo";
    git clone $GITHUB_PREFIX$USERNAME/$repo.git
    echo "Please configure either this script or 'git --config github.user username'"
    fi

    done
  22. @tbranyen tbranyen revised this gist Apr 12, 2011. 1 changed file with 11 additions and 6 deletions.
    17 changes: 11 additions & 6 deletions github.sh
    Original file line number Diff line number Diff line change
    @@ -25,22 +25,27 @@
    #
    # Override these with your own values
    USERNAME=

    # Internal properties
    [email protected]:
    GITHUB_USERNAME=$(git config --global github.user)

    # All arguments
    args=$*

    # Find each repo and pull from github
    for repo in $args; do
    #
    GITUSERNAME= `git config --global github.user`
    if [ !$USERNAME -a $GITUSERNAME ]; then
    $USERNAME=$GITUSERNAME
    # If no username configured, attempt to pull from git --config
    if [ -z "$USERNAME" -a -n "$GITHUB_USERNAME" ]; then
    USERNAME=$GITHUB_USERNAME
    elif [ -z "$USERNAME" -a -n "$GITHUB_USERNAME" ]; then
    echo "Please configure either this script or set: \n\
    git --config github.user username"
    fi

    # If a user provides the parameter username/repo pull in that specific repository.
    if [ `awk -v a="$repo" -v b="/" 'BEGIN{print index(a,b)}'` ]; then
    echo "Pulling in $repo";
    if [ `awk -v repo="$repo" -v delimit="/" 'BEGIN{print index(repo,delimit)}'` -ne 0 ]; then
    echo "Pulling in lol $repo";
    git clone $GITHUB_PREFIX$repo.git

    # Use the default user specified.
  23. @tbranyen tbranyen revised this gist Apr 12, 2011. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion github.sh
    Original file line number Diff line number Diff line change
    @@ -33,7 +33,7 @@ args=$*
    # Find each repo and pull from github
    for repo in $args; do
    #
    GITUSERNAME= `echo git config --global github.user`
    GITUSERNAME= `git config --global github.user`
    if [ !$USERNAME -a $GITUSERNAME ]; then
    $USERNAME=$GITUSERNAME
    fi
  24. @tbranyen tbranyen revised this gist Apr 12, 2011. 1 changed file with 7 additions and 1 deletion.
    8 changes: 7 additions & 1 deletion github.sh
    Original file line number Diff line number Diff line change
    @@ -24,14 +24,20 @@
    #
    #
    # Override these with your own values
    USERNAME=tbranyen
    USERNAME=
    [email protected]:

    # All arguments
    args=$*

    # Find each repo and pull from github
    for repo in $args; do
    #
    GITUSERNAME= `echo git config --global github.user`
    if [ !$USERNAME -a $GITUSERNAME ]; then
    $USERNAME=$GITUSERNAME
    fi

    # If a user provides the parameter username/repo pull in that specific repository.
    if [ `awk -v a="$repo" -v b="/" 'BEGIN{print index(a,b)}'` ]; then
    echo "Pulling in $repo";
  25. @tbranyen tbranyen revised this gist Apr 12, 2011. 1 changed file with 19 additions and 15 deletions.
    34 changes: 19 additions & 15 deletions github.sh
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,24 @@
    #
    # github.sh : Automatically clone multiple repos into a folder,
    # great for setting up a git projects folder.

    #
    # Configuration:
    # Configure the USERNAME variable. chmod +x github.sh.
    #
    # Usage:
    # To pull repos from your GitHub
    # ./github repo1 repo2 repo3
    #
    # To pull repos from others GitHub
    # ./github username/repo1 username/repo2
    #
    # TODO:
    # * Error checking and fallbacks
    # * Automatically pull github username from GIT
    #
    # vim: ts=2:sw=2:sts=2
    #
    #
    # Override these with your own values
    USERNAME=tbranyen
    [email protected]:
    @@ -25,17 +42,4 @@ for repo in $args; do
    echo "Pulling in $USERNAME/$repo";
    git clone $GITHUB_PREFIX$USERNAME/$repo.git
    fi
    done

    # Usage:
    # Configure the USERNAME variable
    # Automatically clone multiple repos into a folder, great for setting up a git projects folder.
    # ./github repo1 repo2 repo3
    #
    #

    # TODO:
    # * Error checking and fallbacks
    # * Automatically pull github username from GIT

    # vim: ts=2:sw=2:sts=2
    done
  26. @tbranyen tbranyen revised this gist Apr 12, 2011. 1 changed file with 6 additions and 2 deletions.
    8 changes: 6 additions & 2 deletions github.sh
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,8 @@
    # Copyright 2011, Tim Branyen @tbranyen <[email protected]>
    # Dual licensed under the MIT and GPL licenses.
    #

    # github.sh : Automatically clone multiple repos into a folder,
    # great for setting up a git projects folder.

    # Override these with your own values
    USERNAME=tbranyen
    @@ -27,11 +28,14 @@ for repo in $args; do
    done

    # Usage:
    # Configure the USERNAME variable
    # Automatically clone multiple repos into a folder, great for setting up a git projects folder.
    # ./github repo1 repo2 repo3
    #
    #

    # TODO:
    # * Error checking and fallbacks
    # * Arguments could be username repo1 repo2 repoN... to make cloning any repo easier
    # * Automatically pull github username from GIT

    # vim: ts=2:sw=2:sts=2
  27. @tbranyen tbranyen revised this gist Apr 12, 2011. 1 changed file with 8 additions and 0 deletions.
    8 changes: 8 additions & 0 deletions github.sh
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,9 @@
    #!/bin/bash
    #
    # Copyright 2011, Tim Branyen @tbranyen <[email protected]>
    # Dual licensed under the MIT and GPL licenses.
    #


    # Override these with your own values
    USERNAME=tbranyen
    @@ -9,9 +14,12 @@ args=$*

    # Find each repo and pull from github
    for repo in $args; do
    # If a user provides the parameter username/repo pull in that specific repository.
    if [ `awk -v a="$repo" -v b="/" 'BEGIN{print index(a,b)}'` ]; then
    echo "Pulling in $repo";
    git clone $GITHUB_PREFIX$repo.git

    # Use the default user specified.
    else
    echo "Pulling in $USERNAME/$repo";
    git clone $GITHUB_PREFIX$USERNAME/$repo.git
  28. @tbranyen tbranyen revised this gist Apr 12, 2011. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion github.sh
    Original file line number Diff line number Diff line change
    @@ -11,7 +11,7 @@ args=$*
    for repo in $args; do
    if [ `awk -v a="$repo" -v b="/" 'BEGIN{print index(a,b)}'` ]; then
    echo "Pulling in $repo";
    git clone $GITHUB_PREFIX/$repo.git
    git clone $GITHUB_PREFIX$repo.git
    else
    echo "Pulling in $USERNAME/$repo";
    git clone $GITHUB_PREFIX$USERNAME/$repo.git
  29. @tbranyen tbranyen revised this gist Apr 12, 2011. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions github.sh
    Original file line number Diff line number Diff line change
    @@ -10,6 +10,8 @@ args=$*
    # Find each repo and pull from github
    for repo in $args; do
    if [ `awk -v a="$repo" -v b="/" 'BEGIN{print index(a,b)}'` ]; then
    echo "Pulling in $repo";
    git clone $GITHUB_PREFIX/$repo.git
    else
    echo "Pulling in $USERNAME/$repo";
    git clone $GITHUB_PREFIX$USERNAME/$repo.git
  30. @tbranyen tbranyen revised this gist Apr 12, 2011. 1 changed file with 5 additions and 2 deletions.
    7 changes: 5 additions & 2 deletions github.sh
    Original file line number Diff line number Diff line change
    @@ -9,8 +9,11 @@ args=$*

    # Find each repo and pull from github
    for repo in $args; do
    echo "Pulling in $repo";
    git clone $GITHUB_PREFIX$USERNAME/$repo.git
    if [ `awk -v a="$repo" -v b="/" 'BEGIN{print index(a,b)}'` ]; then
    else
    echo "Pulling in $USERNAME/$repo";
    git clone $GITHUB_PREFIX$USERNAME/$repo.git
    fi
    done

    # Usage: