Skip to content

Commit

Permalink
Merge pull request #63 from tg-m/master
Browse files Browse the repository at this point in the history
Add custom GitHub URL support
  • Loading branch information
nabobalis authored Apr 18, 2020
2 parents 945dd38 + 0688d71 commit cad966f
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion ablog/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,13 @@ def ablog_post(filename, title=None, **kwargs):
print("Blog post created: %s" % filename)


@arg("--github-url",
dest = "github_url",
type = str,
default = "git@github.com",
help = "Custom GitHub URL. Useful when multiple accounts are configured "
"on the same machine. Default is: git@github.com"
)
@arg(
"--github-token",
dest="github_token",
Expand Down Expand Up @@ -404,6 +411,7 @@ def ablog_deploy(
push_force=False,
github_token=None,
github_is_http=True,
github_url=None,
repodir=None,
**kwargs,
):
Expand All @@ -413,6 +421,9 @@ def ablog_deploy(

github_pages = github_pages or getattr(conf, "github_pages", None)

github_url = github_url or getattr(conf, "github_url", None)
github_url += ":"

website = website or os.path.join(confdir, getattr(conf, "ablog_builddir", "_website"))

tomove = glob.glob(os.path.join(website, "*"))
Expand All @@ -430,7 +441,7 @@ def ablog_deploy(
else:
run(
"git clone "
+ ("https://github.com/" if github_is_http else "git@github.com:")
+ ("https://github.com/" if github_is_http else github_url)
+ "{0}/{0}.github.io.git {1}".format(github_pages, repodir),
echo=True,
)
Expand Down

0 comments on commit cad966f

Please sign in to comment.