-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Esteban Beltran
committed
Apr 19, 2022
1 parent
ea4e6cb
commit 2b9aaa0
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import click | ||
from src.tmux import is_inside_tmux | ||
from src.util import is_tool | ||
import os | ||
import sys | ||
|
||
|
||
@click.command() | ||
@click.argument("tag", required=True) | ||
def checkout(tag): | ||
""" | ||
Quickly creates a new context with the passed PR tag checked out, | ||
then bootstrap and starts kibbe setmeup | ||
""" | ||
if not is_tool("gh"): | ||
click.echo("You must install github cli for this feature to work") | ||
exit(1) | ||
|
||
if not is_inside_tmux(): | ||
click.echo("You must run this command inside a tmux session") | ||
exit(1) | ||
|
||
branch = tag.replace(":", "-") | ||
|
||
kibbe_command = sys.argv[0] | ||
os.system("git branch -D %s" % branch) | ||
os.system("%s ctx -i %s" % (kibbe_command, branch)) | ||
os.system("gh pr checkout %s" % tag) | ||
os.system("%s setmeup --tmux" % kibbe_command) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters