avoid looking for a tracker before config exists
This commit is contained in:
parent
aa51d5d786
commit
821bc14f4b
2 changed files with 4 additions and 5 deletions
|
|
@ -57,14 +57,14 @@ def _create_config(path: str) -> None:
|
|||
return
|
||||
|
||||
|
||||
def create(path: str) -> None:
|
||||
def create(path: str, tracker = 'datalad') -> None:
|
||||
"""
|
||||
Create folder of backlogs.
|
||||
|
||||
"""
|
||||
init(path)
|
||||
init(path, tracker)
|
||||
_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)
|
||||
os.makedirs(os.path.join(path, 'projects'))
|
||||
os.makedirs(os.path.join(path, 'archive'))
|
||||
|
|
|
|||
|
|
@ -36,8 +36,7 @@ def save(path: str, message: str, files: Optional[list[str]]=None) -> None:
|
|||
raise ValueError(f"Tracker {tracker} is not supported.")
|
||||
|
||||
|
||||
def init(path: str) -> None:
|
||||
tracker = get_tracker(path)
|
||||
def init(path: str, tracker: str='datalad') -> None:
|
||||
if tracker == 'datalad':
|
||||
dl.create(path)
|
||||
elif tracker == 'None':
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue