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

Handling git clonefork errors more gracefully #24

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Cali0707
Copy link
Owner

@Cali0707 Cali0707 commented Jul 16, 2023

Fixes #21

To handle the errors more gracefully, we need to:

  • Handle the curl errors silently and provide our own error message
  • Handle the git clone errors silently and provide our own error message

Signed-off-by: Cali0707 <calumramurray@gmail.com>
Signed-off-by: Cali0707 <calumramurray@gmail.com>
@Cali0707 Cali0707 changed the title [WIP]: Handling git clonefork errors more gracefully Handling git clonefork errors more gracefully Jul 16, 2023
@Cali0707 Cali0707 marked this pull request as ready for review July 16, 2023 19:44
@Cali0707 Cali0707 requested a review from Leo6Leo July 16, 2023 19:44
git-clonefork Show resolved Hide resolved

if ! git clone $GIT_ORIGIN 2>/dev/null
then
echo "Failed to clone the repository. Please use a valid url pointing to your fork"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the repo exists in the current directory, the error message should be different.
CleanShot 2023-07-23 at 01 36 50@2x

Currently.
CleanShot 2023-07-23 at 01 33 18@2x

Copy link
Owner Author

@Cali0707 Cali0707 Jul 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Leo6Leo just clarifying, in this scenario the repo exists in the current directory before running git clonefork <url>, and then you run git clonefork <url>?

@Cali0707 Cali0707 added the command/clonefork This affects the git clonefork command label Jul 24, 2023
Signed-off-by: Cali0707 <calumramurray@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
command/clonefork This affects the git clonefork command
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle clonefork errors more gracefully
2 participants