Skip to content

Commit

Permalink
cli: serve: Invert ssh/https flag
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Marques <[email protected]>
  • Loading branch information
gastmaier committed Feb 14, 2025
1 parent 132adf8 commit 823efbd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/custom-doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ jobs:
mkdir -p custom-pages
printf "Introduction\n============\n\n" > custom-pages/intro.rst
yes "lorem ipsum dolor sit amet" 2>/dev/null | head -n 20 | tr '\n' ' ' >> custom-pages/intro.rst
adoc custom-doc --builder pdf --https
adoc custom-doc --builder pdf
- name: Build custom doc
working-directory: /tmp/my_pdf
run: |
adoc custom-doc --builder pdf --https
adoc custom-doc --builder pdf
- name: Store the generated pdf
uses: actions/upload-artifact@v4
Expand Down
12 changes: 6 additions & 6 deletions adi_doctools/cli/custom_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -944,13 +944,13 @@ def organize_include(doc):
help="Builder to use, valid options are: html, pdf (WeasyPrint) (default: html)."
)
@click.option(
'--https',
'-h',
'--ssh',
'-s',
is_flag=True,
default=False,
help="Clone repositories with HTTPS instead of SSH."
help="Clone repositories with SSH instead of HTTPS."
)
def custom_doc(directory, extra, no_parallel_, open_, builder, https):
def custom_doc(directory, extra, no_parallel_, open_, builder, ssh):
"""
Creates an aggregated documentation out the repos
in the doc.yaml file.
Expand Down Expand Up @@ -1026,15 +1026,15 @@ def custom_doc(directory, extra, no_parallel_, open_, builder, https):
return

p = []
remote = lut['remote_https'] if https else lut['remote_ssh']
remote = lut['remote_https'] if not ssh else lut['remote_ssh']
for r in doc['include']:
cwd = path.join(directory, r)
if not path.isdir(cwd):
git_cmd = ["git", "clone", remote.format(r), "--depth=1", "-b",
doc['config'][repo]['branch'], '--', cwd]
pr.popen(git_cmd, p)
if pr.wait(p) != 0:
click.echo("Failed to clone one or more repositories (hint: --https flag).")
click.echo("Failed to clone one or more repositories (hint: --ssh flag).")

if builder == "pdf":
environ["ADOC_MEDIA_PRINT"] = ""
Expand Down

0 comments on commit 823efbd

Please sign in to comment.