debasisdwivedy commited on
Commit
feb5fc6
·
1 Parent(s): 9522d74

Zip and download

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -124,6 +124,9 @@ def zip_and_download():
124
  temp_dir = tempfile.mkdtemp()
125
  zip_path = os.path.join(temp_dir, ZIP_NAME)
126
 
 
 
 
127
  # Create ZIP archive
128
  shutil.make_archive(zip_path.replace(".zip", ""), "zip", FOLDER_TO_ZIP)
129
  if os.path.exists(FOLDER_TO_ZIP):
 
124
  temp_dir = tempfile.mkdtemp()
125
  zip_path = os.path.join(temp_dir, ZIP_NAME)
126
 
127
+ if not os.path.exists(FOLDER_TO_ZIP):
128
+ raise gr.Error("WORKSPACE Folder does not exist!")
129
+
130
  # Create ZIP archive
131
  shutil.make_archive(zip_path.replace(".zip", ""), "zip", FOLDER_TO_ZIP)
132
  if os.path.exists(FOLDER_TO_ZIP):