Skip to content

Commit 78b4411

Browse files
committed
Check path exists.
1 parent 1cddc21 commit 78b4411

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

manage.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
#!/usr/bin/env python
22
"""Django's command-line utility for administrative tasks."""
33
import os
4+
from os import path
45
import sys
56

67
from helper import *
78

89
def init_sherlock():
910
"""Get the newest Sherlock project."""
1011
print("[INFO] Prepare for Sherlock Project..")
11-
os.system(f"git clone https://github.com/sherlock-project/sherlock {sherlock_dir()}");
12-
cmd_in_dir(sherlock_dir(), f"git pull") # Update to the newest version
12+
if path.exists(sherlock_dir()):
13+
cmd_in_dir(sherlock_dir(), f"git pull") # Update to the newest version
14+
else: # Othersie, clone it once
15+
os.system(f"git clone https://github.com/sherlock-project/sherlock {sherlock_dir()}");
1316
os.system(f"{py_command()} -m pip install -r {sherlock_dir()}/requirements.txt")
1417
os.system(f"{py_command()} {sherlock_dir()}/sherlock --version")
1518

0 commit comments

Comments
 (0)