avoid looking for a tracker before config exists
Some checks failed
Ruff / ruff (push) Waiting to run
Mypy / mypy (push) Failing after 1m8s
Pytest / pytest (3.12) (push) Successful in 49s
Pytest / pytest (3.13) (push) Has been cancelled
Pytest / pytest (3.14) (push) Has been cancelled

This commit is contained in:
Justus Kuhlmann 2025-12-04 12:36:41 +01:00
commit 821bc14f4b
Signed by: jkuhl
GPG key ID: 00ED992DD79B85A6
2 changed files with 4 additions and 5 deletions

View file

@ -57,14 +57,14 @@ def _create_config(path: str) -> None:
return return
def create(path: str) -> None: def create(path: str, tracker = 'datalad') -> None:
""" """
Create folder of backlogs. Create folder of backlogs.
""" """
init(path) init(path, tracker)
_create_db(os.path.join(path, 'backlogger.db')) _create_db(os.path.join(path, 'backlogger.db'))
os.chmod(os.path.join(path, 'backlogger.db'), 0o666) # why does this not work? os.chmod(os.path.join(path, 'backlogger.db'), 0o666)
_create_config(path) _create_config(path)
os.makedirs(os.path.join(path, 'projects')) os.makedirs(os.path.join(path, 'projects'))
os.makedirs(os.path.join(path, 'archive')) os.makedirs(os.path.join(path, 'archive'))

View file

@ -36,8 +36,7 @@ def save(path: str, message: str, files: Optional[list[str]]=None) -> None:
raise ValueError(f"Tracker {tracker} is not supported.") raise ValueError(f"Tracker {tracker} is not supported.")
def init(path: str) -> None: def init(path: str, tracker: str='datalad') -> None:
tracker = get_tracker(path)
if tracker == 'datalad': if tracker == 'datalad':
dl.create(path) dl.create(path)
elif tracker == 'None': elif tracker == 'None':