redun
redun copied to clipboard
Tempdir in script
This is changes how redun scripts create and manage the optional temp dir.
Previously the temp dir was created and later removed by the "host" machine. This led to errors using tempdir=True
on remote tasks. (Issue: #20)
With this change, the tempdir creation and removal happens within the shell script that redun generates to wrap the user command. This means it all happens in one place, and the error mentioned above is avoided.
Note- I used the shell scripting pattern mentioned in this stackoverflow to schedule the deletion whenever the script exits. I'm not super confident that this is the best way to do the cleanup, but it seems functional and didn't require me to muck about in get_wrapped_command()
. Happy to update based on feedback or just leave this here as a simple demo.
Cheers!