thhung
commited on
Commit
·
a28223d
1
Parent(s):
19b1985
[app] update logic clone
Browse files
app.py
CHANGED
@@ -6,7 +6,14 @@ import shutil
|
|
6 |
|
7 |
git_url = os.getenv("GIT_URL")
|
8 |
repo_dir = "./temp"
|
9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
# Specify the folder you want to move and the current folder path
|
12 |
source_folder = "./temp/hnrecommender/"
|
|
|
6 |
|
7 |
git_url = os.getenv("GIT_URL")
|
8 |
repo_dir = "./temp"
|
9 |
+
# Specify the path to the folder
|
10 |
+
# Check if the folder exists and remove it if it does
|
11 |
+
if os.path.exists(repo_dir) and os.path.isdir(repo_dir):
|
12 |
+
print(f"Already clone")
|
13 |
+
else:
|
14 |
+
print(f"Folder '{repo_dir}' does not exist.")
|
15 |
+
Repo.clone_from(git_url, repo_dir)
|
16 |
+
|
17 |
|
18 |
# Specify the folder you want to move and the current folder path
|
19 |
source_folder = "./temp/hnrecommender/"
|