Change working dir to dir of script.

pull/7/head
Ferry Boender 10 years ago
parent 2e4d040528
commit 2be059f71a
  1. 2
      src/scriptform.py

@ -284,6 +284,8 @@ class FormConfig:
def callback_script(self, form, form_values, output_fh=None): def callback_script(self, form, form_values, output_fh=None):
# Pass form values to the script through the environment as strings. # Pass form values to the script through the environment as strings.
os.chdir(os.path.dirname(form.script))
env = os.environ.copy() env = os.environ.copy()
for k, v in form_values.items(): for k, v in form_values.items():
env[k] = str(v) env[k] = str(v)

Loading…
Cancel
Save