Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -72,7 +72,7 @@ def followup():
|
|
72 |
|
73 |
#run a GPT command or reject it
|
74 |
def runCmd(flag):
|
75 |
-
if flag:
|
76 |
with st.spinner('Running command \'' + st.session_state['command'] + '\''):
|
77 |
try:
|
78 |
p = subprocess.Popen(st.session_state['command'], shell=True, stderr=subprocess.STDOUT, stdout=subprocess.PIPE)
|
@@ -114,7 +114,7 @@ with cola:
|
|
114 |
f.write(uploadFile.getbuffer())
|
115 |
st.write('Success')
|
116 |
with colb:
|
117 |
-
if st.button('
|
118 |
shutil.make_archive(os.path.join(thispath, 'files'), 'zip', os.path.join(thispath, 'files'))
|
119 |
st.session_state['download'] = True
|
120 |
with colc:
|
|
|
72 |
|
73 |
#run a GPT command or reject it
|
74 |
def runCmd(flag):
|
75 |
+
if flag and (not st.session_state['command'].startswith('rm ')):
|
76 |
with st.spinner('Running command \'' + st.session_state['command'] + '\''):
|
77 |
try:
|
78 |
p = subprocess.Popen(st.session_state['command'], shell=True, stderr=subprocess.STDOUT, stdout=subprocess.PIPE)
|
|
|
114 |
f.write(uploadFile.getbuffer())
|
115 |
st.write('Success')
|
116 |
with colb:
|
117 |
+
if st.button('Make Zip'):
|
118 |
shutil.make_archive(os.path.join(thispath, 'files'), 'zip', os.path.join(thispath, 'files'))
|
119 |
st.session_state['download'] = True
|
120 |
with colc:
|