Skip to content

Commit 3a0b376

Browse files
Kaushal ShahKaushal Shah
Kaushal Shah
authored and
Kaushal Shah
committed
Handled the case when repo already exists
1 parent 7744948 commit 3a0b376

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
name="snowcomp",
77
packages=['snowcomp'],
88
package_dir={'snowcomp': 'snowcomp'},
9-
version="1.7",
9+
version="1.8",
1010
author="kaushal28",
1111
entry_points={'console_scripts': ['snowcomp = snowcomp.__main__:main' ]},
1212
author_email="[email protected]",

snowcomp/__main__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ def is_ignored(class_name, ignored):
4242
try:
4343
username, password, repo_link, latest_branch, old_branch, clone_path, instance, ignore_deletions = get_config()
4444
update_dir = os.path.join(clone_path, 'update')
45-
repository = Repo.clone_from(f'{repo_link[:8]}{username}:{password}@{repo_link[8:]}', clone_path)
45+
# If repo already exists, don't clone
46+
repository = Repo(clone_path, search_parent_directories = True) if os.path.isdir(clone_path) else Repo.clone_from(f'{repo_link[:8]}{username}:{password}@{repo_link[8:]}', clone_path)
4647
repository.git.checkout(latest_branch)
4748
latest_files = get_class_sys_id_dict(update_dir)
4849
repository.git.checkout(old_branch)

0 commit comments

Comments
 (0)