script-server icon indicating copy to clipboard operation
script-server copied to clipboard

Output Files and Working Dir

Open rgomez-eng opened this issue 3 years ago • 2 comments

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.

rgomez-eng avatar Apr 23 '22 20:04 rgomez-eng

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:

  • please use absolute paths in your script, it should make it more transparent
  • also use the same absolute path in output_files

bugy avatar Apr 25 '22 07:04 bugy

Thanks a lot. This worked right away.

rgomez-eng avatar Apr 25 '22 09:04 rgomez-eng