Skip to content

Commit

Permalink
Remove if else statement
Browse files Browse the repository at this point in the history
  • Loading branch information
knightdave committed May 12, 2021
1 parent 23f91af commit 4c4010a
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions hugo/internal/github_hugo_theme.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,14 @@ filegroup(

DEFAULT_GITHUB_HOST = "github.com"

def github_hugo_theme(name, owner, repo, commit, github_host=None, **kwargs):
if github_host:
url = "https://{github_host}/{owner}/{repo}/archive/{commit}.zip".format(
owner = owner,
repo = repo,
commit = commit,
github_host = github_host,
)
else:
url = "https://{github_host}/{owner}/{repo}/archive/{commit}.zip".format(
owner = owner,
repo = repo,
commit = commit,
github_host = DEFAULT_GITHUB_HOST,
)
def github_hugo_theme(name, owner, repo, commit, github_host=DEFAULT_GITHUB_HOST, **kwargs):

url = "https://{github_host}/{owner}/{repo}/archive/{commit}.zip".format(
owner = owner,
repo = repo,
commit = commit,
github_host = github_host,
)
strip_prefix = "{repo}-{commit}".format(
repo = repo,
commit = commit,
Expand Down

0 comments on commit 4c4010a

Please sign in to comment.