Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return exit status 1 for clone failure #45

Merged
merged 1 commit into from
Oct 30, 2014

Conversation

k0kubun
Copy link
Contributor

@k0kubun k0kubun commented Oct 20, 2014

I want to write a script which switches its behavior depending on ghq get's result.
But currently ghq get returns 0 even if it fails. So I changed the exit status to 1.

before

$ ghq get foo/bar; echo $?
     clone https://github.com/foo/bar -> /Users/k0kubun/src/github.com/foo/bar
       git clone https://github.com/foo/bar /Users/k0kubun/src/github.com/foo/bar
Cloning into '/Users/k0kubun/src/github.com/foo/bar'...
remote: Repository not found.
fatal: repository 'https://github.com/foo/bar/' not found
0

after

$ ghq get foo/bar; echo $?
     clone https://github.com/foo/bar -> /Users/k0kubun/src/github.com/foo/bar
       git clone https://github.com/foo/bar /Users/k0kubun/src/github.com/foo/bar
Cloning into '/Users/k0kubun/src/github.com/foo/bar'...
remote: Repository not found.
fatal: repository 'https://github.com/foo/bar/' not found
     error Could not find repository: /usr/bin/git: exit status 128
1

@motemen
Copy link
Member

motemen commented Oct 30, 2014

Thanks!

motemen added a commit that referenced this pull request Oct 30, 2014
Return exit status 1 for clone failure
@motemen motemen merged commit 4c6dbd6 into x-motemen:master Oct 30, 2014
@k0kubun k0kubun deleted the clone_exit_status branch October 30, 2014 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants