update script
Browse files- download_files.sh +0 -0
- get_download_links.py +5 -0
download_files.sh
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
get_download_links.py
CHANGED
@@ -22,6 +22,11 @@ for root, dirs, files in os.walk('.'):
|
|
22 |
with open('download_files.sh', 'w') as bash_script:
|
23 |
bash_script.write("#!/bin/bash\n\n")
|
24 |
for url, relative_path in urls:
|
|
|
|
|
|
|
|
|
|
|
25 |
bash_script.write(f"if [ ! -f \"{relative_path}\" ]; then\n")
|
26 |
bash_script.write(f" wget -O \"{relative_path}\" \"{url}\"\n")
|
27 |
bash_script.write("fi\n\n")
|
|
|
22 |
with open('download_files.sh', 'w') as bash_script:
|
23 |
bash_script.write("#!/bin/bash\n\n")
|
24 |
for url, relative_path in urls:
|
25 |
+
# Extract directory path
|
26 |
+
dir_path = os.path.dirname(relative_path)
|
27 |
+
# Add command to create directory if it doesn't exist
|
28 |
+
if dir_path:
|
29 |
+
bash_script.write(f"mkdir -p \"{dir_path}\"\n")
|
30 |
bash_script.write(f"if [ ! -f \"{relative_path}\" ]; then\n")
|
31 |
bash_script.write(f" wget -O \"{relative_path}\" \"{url}\"\n")
|
32 |
bash_script.write("fi\n\n")
|