cbg342 commited on
Commit
7ab0db8
1 Parent(s): 86ebbd6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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('Download'):
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: