Skip to content

Commit b41eeac

Browse files
committed
format
1 parent b4b6f24 commit b41eeac

4 files changed

Lines changed: 55 additions & 9 deletions

File tree

pretext/cli.py

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -945,12 +945,39 @@ def callback(actual_port: int) -> None:
945945
)
946946
@nice_errors
947947
@click.pass_context
948-
@click.option("-u", "--update-source", is_flag=True, required=False, help="Commit and push changes tot he source files at the same time as deploying output.")
949-
@click.option("-s", "--stage-only", is_flag=True, required=False, help="Create a staged deployment, but do not deploy.")
950-
@click.option("-p", "--preview", is_flag=True, required=False, help="Preview the staged deployment, but do not actually deploy.")
951-
@click.option("--no-push", is_flag=True, required=False, help="Do not push to remote. Useful for CI/CD workflows or in case of authentication errors.")
948+
@click.option(
949+
"-u",
950+
"--update-source",
951+
is_flag=True,
952+
required=False,
953+
help="Commit and push changes tot he source files at the same time as deploying output.",
954+
)
955+
@click.option(
956+
"-s",
957+
"--stage-only",
958+
is_flag=True,
959+
required=False,
960+
help="Create a staged deployment, but do not deploy.",
961+
)
962+
@click.option(
963+
"-p",
964+
"--preview",
965+
is_flag=True,
966+
required=False,
967+
help="Preview the staged deployment, but do not actually deploy.",
968+
)
969+
@click.option(
970+
"--no-push",
971+
is_flag=True,
972+
required=False,
973+
help="Do not push to remote. Useful for CI/CD workflows or in case of authentication errors.",
974+
)
952975
def deploy(
953-
ctx: click.Context, update_source: bool, stage_only: bool, preview: bool, no_push: bool
976+
ctx: click.Context,
977+
update_source: bool,
978+
stage_only: bool,
979+
preview: bool,
980+
no_push: bool,
954981
) -> None:
955982
"""
956983
Automatically deploys project to GitHub Pages,

pretext/project/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1615,7 +1615,9 @@ def deploy(
16151615
if not skip_staging:
16161616
self.stage_deployment()
16171617
if not stage_only:
1618-
utils.publish_to_ghpages(self.stage_abspath(), update_source, no_push=no_push)
1618+
utils.publish_to_ghpages(
1619+
self.stage_abspath(), update_source, no_push=no_push
1620+
)
16191621

16201622
def is_git_managed(self) -> bool:
16211623
return (self.abspath() / ".git").exists()

pretext/resources/resource_hash_table.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,5 +82,16 @@
8282
".gitignore": "4a7a09d3441f01b6a9bf658e68d1deff640b6b2cf463af3f5e77c2507600b602",
8383
".devcontainer.json": "d65bac0873f7f46bbc636b2854c7a3bc8e7f21028885a624b9745d53ef4e95f9",
8484
"pretext-cli.yml": "0ea2df984dcfb76ecfaa9bfde26a0da22c006fca1fafd156ca6c57c75679b907"
85+
},
86+
"2.15.3": {
87+
"project.ptx": "04a5cc261a1e79a9f343e09453ec4f9e33db72d41558c99e809f5f79a5500302",
88+
"codechat_config.yaml": "c5fd966cb16207a319bfea049202128f5138acd0a6c6b16a79146723209c3c6f",
89+
".gitignore": "cc22fcc43511794aaca2fb780622ac41942323f66b6177377ac21b058b26df5d",
90+
"devcontainer.json": "ca9b8929b791644c6f051c2b02552438a8d042362ab53da4aca039c8e0e41124",
91+
"pretext-cli.yml": "8b77b4d693dc8bf373e536f48a0fe03d0772c50bd4aef9097fc1ff9d0f8de197",
92+
"installPretext.sh": "fef7c96f58879bbbb81eed409f53b41561750d34dbac2edae8a82af2e9a8502e",
93+
"installPandoc.sh": "615e3111ba699ee387e3f1dd829a4d19f3be0f5dea94895f5f52fcb7dac48dfd",
94+
"installLatex.sh": "2a72ac6d45c58c81126e7d743113f4d08510496d0ae8ce015c18da6f2a954968",
95+
"installSage.sh": "66364cf54d30a278a3de9cf643e0497548a5f49b7c738bfc2dd56088471813f9"
8596
}
8697
}

pretext/utils.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,9 @@ def parse_git_remote(string: str) -> t.List[str]:
630630
return repo_info[-2:]
631631

632632

633-
def publish_to_ghpages(directory: Path, update_source: bool, no_push: bool = False) -> None:
633+
def publish_to_ghpages(
634+
directory: Path, update_source: bool, no_push: bool = False
635+
) -> None:
634636
"""
635637
Publish the current project to GitHub pages.
636638
"""
@@ -666,7 +668,9 @@ def publish_to_ghpages(directory: Path, update_source: bool, no_push: bool = Fal
666668
repo.active_branch.rename("main")
667669
log.info("Successfully initialized new Git repository!")
668670
log.info("")
669-
log.info(f"Preparing to deploy from active `{repo.active_branch.name}` git branch.\n")
671+
log.info(
672+
f"Preparing to deploy from active `{repo.active_branch.name}` git branch.\n"
673+
)
670674
if repo.bare or repo.is_dirty() or len(repo.untracked_files) > 0:
671675
log.info("Changes to project source since last commit detected.")
672676
if update_source:
@@ -762,7 +766,9 @@ def publish_to_ghpages(directory: Path, update_source: bool, no_push: bool = Fal
762766
log.info(
763767
"Make sure you can push changes, either from the command line or in VS Code. Then try to deploy again.\n"
764768
)
765-
log.info("You can also try to run `pretext deploy --no-push` to skip this step, then switch to the `gh-pages` branch (using `git checkout gh-pages`) and push manually.")
769+
log.info(
770+
"You can also try to run `pretext deploy --no-push` to skip this step, then switch to the `gh-pages` branch (using `git checkout gh-pages`) and push manually."
771+
)
766772
log.info("")
767773
log.info(f"(If `{origin.url}` doesn't match your GitHub repository,")
768774
log.info(

0 commit comments

Comments
 (0)