diff --git a/src/_nebari/initialize.py b/src/_nebari/initialize.py index 69e9fb1b2..d176c9e20 100644 --- a/src/_nebari/initialize.py +++ b/src/_nebari/initialize.py @@ -549,9 +549,9 @@ def github_auto_provision(config, owner, repo): def git_repository_initialize(git_repository): - if not git.is_git_repo("./"): - git.initialize_git("./") - git.add_git_remote(git_repository, path="./", remote_name="origin") + if not git.is_git_repo(Path.cwd()): + git.initialize_git(Path.cwd()) + git.add_git_remote(git_repository, path=Path.cwd(), remote_name="origin") def auth0_auto_provision(config): diff --git a/src/_nebari/provider/git.py b/src/_nebari/provider/git.py index e731ad5d5..7e90d06df 100644 --- a/src/_nebari/provider/git.py +++ b/src/_nebari/provider/git.py @@ -6,12 +6,12 @@ from _nebari.utils import change_directory -def is_git_repo(path=None): +def is_git_repo(path: Path = None): path = path or Path.cwd() return ".git" in os.listdir(path) -def initialize_git(path=None): +def initialize_git(path: Path = None): path = path or Path.cwd() with change_directory(path): subprocess.check_output(["git", "init"]) @@ -19,7 +19,7 @@ def initialize_git(path=None): subprocess.check_output(["git", "checkout", "-b", "main"]) -def add_git_remote(remote_path, path=None, remote_name="origin"): +def add_git_remote(remote_path: str, path: Path = None, remote_name: str = "origin"): path = path or Path.cwd() c = configparser.ConfigParser()