Skip to content

Commit

Permalink
Merge branch 'main' into correction-format-check-github-workflow-task
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicoretti authored Dec 16, 2024
2 parents 5ea476f + bdff2a1 commit 22e9907
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 3 deletions.
1 change: 1 addition & 0 deletions doc/changes/unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@

* Fixed `index.rst` documentation template to provide the correct underlining length of the main heading
* Added multi-version extension to Sphinx configuration of the project template
* fixed bug in tbx worflow install error if directory exists[#298](https://github.com/exasol/python-toolbox/issues/298) also [#297](https://github.com/exasol/python-toolbox/issues/297)
4 changes: 2 additions & 2 deletions exasol/toolbox/tools/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def install_template(template: str, dest: Path, pkg: str, template_type: str) ->
Attention: If there is an existing template with the same name it will be overwritten!
"""
if not dest.exists():
dest.mkdir()
dest.mkdir(parents=True)

try:
templates = _select_templates(template, pkg, template_type)
Expand All @@ -139,7 +139,7 @@ def update_template(
) -> None:
"""Similar to install but checks for existing templates and shows diff"""
if not dest.exists():
dest.mkdir()
dest.mkdir(parents=True)

try:
templates = _select_templates(template, pkg, template_type)
Expand Down
1 change: 0 additions & 1 deletion exasol/toolbox/tools/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ def install_workflow(
Attention: If there is an existing workflow with the same name it will be overwritten!
"""
dest.mkdir(parents=True)
template.install_template(
template=workflow, dest=dest, pkg=PKG, template_type=TEMPLATE_TYPE
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Create project directory
$ mkdir .github
$ mkdir -p .github/workflows

install issue
$ tbx issue install bug
Installed bug in .github/ISSUE_TEMPLATE/bug.md
12 changes: 12 additions & 0 deletions test/integration/cli/issue-install-if-issue-exist
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
install issue template
$ tbx issue install feature
Installed feature in .github/ISSUE_TEMPLATE/feature.md

install another issue template
$ tbx issue install bug
Installed bug in .github/ISSUE_TEMPLATE/bug.md

Install another issue template while an issue template with the same name already exists
$ touch .github/ISSUE_TEMPLATE/refactoring.md
$ tbx issue install refactoring
Installed refactoring in .github/ISSUE_TEMPLATE/refactoring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Create project directory
$ mkdir -p .github/workflows

install workflow
$ tbx workflow install pr-merge
Installed pr-merge in .github/workflows/pr-merge.yml
12 changes: 12 additions & 0 deletions test/integration/cli/workflow-install-if-workflow-exists
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
install workflow
$ tbx workflow install cd
Installed cd in .github/workflows/cd.yml

install another workflow
$ tbx workflow install checks
Installed checks in .github/workflows/checks.yml

install workflow while a workflow with this name already exists
$ touch .github/workflows/ci.yml
$ tbx workflow install ci
Installed ci in .github/workflows/ci.yml

0 comments on commit 22e9907

Please sign in to comment.