Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions dot_local/bin/executable_gh-pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ if ! command_exists git; then
exit 1
fi

if ! gh repo set-default --view > /dev/null 2>&1; then
Copy link
Owner

Choose a reason for hiding this comment

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

@jules does this only occur if it needs to be set?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes! The gh repo set-default --view command only fails (returns a non-zero exit code) if a default repository hasn't been set yet. If one is already set, it successfully views it and returns 0, so the if block is skipped and the script continues.

echo "X No default remote repository has been set." >&2
echo "please run \`gh repo set-default\` to select a default remote repository." >&2
exit 1
fi

# Store original branch
original_branch=$(git branch --show-current)

Expand Down
6 changes: 6 additions & 0 deletions dot_local/bin/executable_gh-release.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
#!/bin/sh
set -eux

if ! gh repo set-default --view > /dev/null 2>&1; then
echo "X No default remote repository has been set." >&2
Copy link
Owner

Choose a reason for hiding this comment

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

@jules does this only occur if it needs to be set?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes! The gh repo set-default --view command only fails (returns a non-zero exit code) if a default repository hasn't been set yet. If one is already set, it successfully views it and returns 0, so the if block is skipped and the script continues.

echo "please run \`gh repo set-default\` to select a default remote repository." >&2
exit 1
fi

prerelease_flag=""
git_tag_inc_args=""

Expand Down