Skip to content

Commit

Permalink
add git task
Browse files Browse the repository at this point in the history
  • Loading branch information
goFrendiAsgard committed Jan 7, 2024
1 parent 66353d1 commit 049f3d2
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions src/zrb/builtin/git.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from zrb.helper.typing import Any
from zrb.builtin.group import git_group
from zrb.task.decorator import python_task
from zrb.task.decorator import python_task, CmdTask
from zrb.task_input.str_input import StrInput
from zrb.task_input.bool_input import BoolInput
from zrb.runner import runner
Expand All @@ -12,6 +12,22 @@
# Task Definitions
###############################################################################

clear_branch = CmdTask(
name='clear-branch',
group=git_group,
description='Clear branches',
cmd=[
'for BRANCH in $(git branch)',
'do',
' if [ "$BRANCH" != "main" ]',
' then',
' git branch -D $BRANCH',
' fi',
'done',
]
)
runner.register(clear_branch)


@python_task(
name='get-file-changes',
Expand Down Expand Up @@ -40,7 +56,7 @@
BoolInput(
name='include-updated',
description='include updated file',
prompt='Include removed file',
prompt='Include updated file',
default=True
),
],
Expand Down

0 comments on commit 049f3d2

Please sign in to comment.