Skip to content

Commit

Permalink
Two cupid_webpage fixes
Browse files Browse the repository at this point in the history
1. Depending on how your environment is configured, you either need to import
util or cupid.util (and git_helper or cupid.git_helper); added try / except
blocks for both imports
2. Don't update github_pages_dir to a realpath unless it is non-empty (want to
keep default behavior of not doing anything if user doesn't specify -g option;
I was getting

RuntimeError: When specifying -g/--github-pages-dir, you must also provide -n/--name

even when not specifying -g)
  • Loading branch information
mnlevy1981 committed Mar 7, 2025
1 parent fc3c638 commit 7375748
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions cupid/cupid_webpage.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,18 @@
from urllib.parse import quote

import click
from git_helper import GitHelper
from util import get_control_dict
from util import is_bad_env

try:
from git_helper import GitHelper
except ModuleNotFoundError:
from cupid.git_helper import GitHelper

try:
from util import get_control_dict
from util import is_bad_env
except ModuleNotFoundError:
from cupid.util import get_control_dict
from cupid.util import is_bad_env


def github_pages_publish(
Expand Down Expand Up @@ -149,8 +158,8 @@ def build(config_path, github_pages_dir, name, overwrite):
control = get_control_dict(config_path)

# Check and process arguments
github_pages_dir = os.path.realpath(github_pages_dir)
if github_pages_dir:
github_pages_dir = os.path.realpath(github_pages_dir)
github_pages_dir_thisversion, git_repo = github_pages_args(
github_pages_dir,
name,
Expand Down

0 comments on commit 7375748

Please sign in to comment.