Skip to content

Commit 18cd9d7

Browse files
committed
chore(script.deploy): fix clone remote url
1 parent 5a5af26 commit 18cd9d7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

scripts/deploy-site.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ def main(argv: list[str] | None = None):
155155
git_last_commit = gitget(["rev-parse", "HEAD"], cwd=git_dir)
156156
git_current_branch = gitget(["branch", "--show-current"], cwd=git_dir)
157157
git_remote_status = gitget(["status", "--short", "--b", "--porcelain"], cwd=git_dir)
158+
git_remote_url = gitget(["remote", "get-url", "origin"], cwd=git_dir)
158159

159160
if git_current_branch != "main":
160161
errexit(f"expected current git branch to be 'main'; got '{git_current_branch}'")
@@ -185,12 +186,15 @@ def main(argv: list[str] | None = None):
185186

186187
tmp_dir = Path(tmp_dir)
187188
clone_dir = tmp_dir / "repo"
189+
LOGGER.debug(f"cloning to '{clone_dir}'")
188190
# note: the clone preserve the currently active branch/commit
189191
gitc(
190192
["clone", "--local", "--no-hardlinks", str(git_dir), str(clone_dir)],
191193
cwd=tmp_dir,
192194
)
193195
git_dir = clone_dir
196+
LOGGER.debug(f"changing origin to '{git_remote_url}'")
197+
gitc(["remote", "set-url", "origin", git_remote_url], cwd=git_dir)
194198

195199
# // prepare site config
196200

0 commit comments

Comments
 (0)