Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -16,4 +16,23 @@ if st.sidebar.button("Create File"):
|
|
16 |
# code to create a file
|
17 |
|
18 |
if st.sidebar.button("Delete File"):
|
19 |
-
# code to delete a file
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
# code to create a file
|
17 |
|
18 |
if st.sidebar.button("Delete File"):
|
19 |
+
# code to delete a file
|
20 |
+
|
21 |
+
def pull_files_from_github_url(url):
|
22 |
+
import os
|
23 |
+
# Using GitPython library
|
24 |
+
from git import Repo
|
25 |
+
|
26 |
+
# Get the directory where the file will be downloaded
|
27 |
+
dir_name = os.path.basename(url).split('.')[0]
|
28 |
+
|
29 |
+
# Clone the repo
|
30 |
+
Repo.clone_from(url, dir_name)
|
31 |
+
|
32 |
+
# Get the list of files
|
33 |
+
repo = Repo(dir_name)
|
34 |
+
return [item.a_path for item in repo.tree.traverse()]
|
35 |
+
|
36 |
+
|
37 |
+
url = 'https://github.com/AaronCWacker/Yggdrasil'
|
38 |
+
pull_files_from_github_url(url)
|