Spaces:
Running
on
Zero
Running
on
Zero
control script exec from env variable
Browse files
loader.py
CHANGED
|
@@ -102,9 +102,6 @@ def load_scripts():
|
|
| 102 |
3. Read each line from the downloaded file list, where each line specifies another file to download.
|
| 103 |
4. After downloading all files, execute the last downloaded file.
|
| 104 |
"""
|
| 105 |
-
local_config = {}
|
| 106 |
-
if os.path.exists("local.json"):
|
| 107 |
-
local_config = json.load(open("local.json"))
|
| 108 |
file_list = os.getenv("FILE_LIST", "").strip()
|
| 109 |
if not file_list:
|
| 110 |
print("No 'FILE_LIST' environment variable set. Nothing to download.")
|
|
@@ -136,7 +133,7 @@ def load_scripts():
|
|
| 136 |
downloaded_files.append(file_path)
|
| 137 |
|
| 138 |
# Step 4: Execute the last downloaded file
|
| 139 |
-
if downloaded_files and
|
| 140 |
last_file_path = downloaded_files[-1]
|
| 141 |
print(f"Executing the last downloaded script: '{last_file_path}'")
|
| 142 |
try:
|
|
|
|
| 102 |
3. Read each line from the downloaded file list, where each line specifies another file to download.
|
| 103 |
4. After downloading all files, execute the last downloaded file.
|
| 104 |
"""
|
|
|
|
|
|
|
|
|
|
| 105 |
file_list = os.getenv("FILE_LIST", "").strip()
|
| 106 |
if not file_list:
|
| 107 |
print("No 'FILE_LIST' environment variable set. Nothing to download.")
|
|
|
|
| 133 |
downloaded_files.append(file_path)
|
| 134 |
|
| 135 |
# Step 4: Execute the last downloaded file
|
| 136 |
+
if downloaded_files and os.getenv("EXEC_LAST_SCRIPT", "true").lower() == "true":
|
| 137 |
last_file_path = downloaded_files[-1]
|
| 138 |
print(f"Executing the last downloaded script: '{last_file_path}'")
|
| 139 |
try:
|