bugy / script-server

Web UI for your scripts with execution management
Other
1.57k stars 248 forks source link

Output Files and Working Dir #550

Closed rgomez-eng closed 1 year ago

rgomez-eng commented 2 years ago

Not sure I'm understanding the working dir and output files correctly.

My script is generating a file,

with open('test.txt', 'w') as f:
    f.write('Create a new text file!')

And my runner config is like this,

 "output_files": [
    "~/*.txt"
  ]

What I understand is that if a working dir is not set the file will be generated in the /app directory (Docker). So setting a working dir makes sure the file is generated in the correct folder, in this case /app/temp/test so it gets deleted in my weekly clean up script.

However this is not working, pretty sure because I'm understanding this all wrong.

bugy commented 2 years ago

Hi @rgomez-eng, if a working directory is not set, the file should be generated in script folder (which is /app in docker), that's correct. And the home folder ~ should reference to smth else (I believe this would be /).

So, I would suggest:

rgomez-eng commented 2 years ago

Thanks a lot. This worked right away.