sphuber / aiida-shell

AiiDA plugin that makes running shell commands easy.
MIT License
14 stars 7 forks source link

Add a check that input files are not overwritten by output files #68

Closed sphuber closed 9 months ago

sphuber commented 10 months ago

Currently it is possible to run the following:

launch_shell_job(
    'command',
    arguments='{input_file}',
    nodes={
        'input_file': SinglefileData.from_string('content', filename='stdout'),
    }
)

which will result in the script:

'command' 'stdout' > 'stdout'

Here the input_file file was written to the working directory with the name stdout, as that is the filename attribute of the SinglefileData node, but this would be overwritten by the output of the stdout which would also be redirected to stdout. There should be validation that either prevents this by raising an error, or automatically renames the in- or output file.