Skip to content

Commit

Permalink
Ensure path is Path object (#1888)
Browse files Browse the repository at this point in the history
  • Loading branch information
iameskild committed Aug 4, 2023
1 parent 0f4e204 commit 07d903f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/_nebari/initialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
6 changes: 3 additions & 3 deletions src/_nebari/provider/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@
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"])
# Ensure initial branch is called main
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()
Expand Down

0 comments on commit 07d903f

Please sign in to comment.