There are two minor changes here that make interaction with the recording file and output directory more intuitive.
1. If the recording file doesn't exist, don't create the output directory.
Previously, even if the specified recording file didn't exist, an error was printed and shinycannon would exit. However, the output directory would still be created, and populated with debug.log if --debug-log was specified.
Shalu and I both found this counter-intuitive. It didn't make sense for an output directory to be created when there was no possible interesting output data to store.
Now, existence of the file is checked before any output directory or log files are created, and shinycannon exits immediately without creating any directories or files if the recording file doesn't exist.
2. Respect --overwrite-output.
Previously, even if --overwrite-output was specified -- indicating that the output directory should be deleted and recreated even it exists already -- shinycannon would still refuse to delete the output directory if it didn't contain files that an output directory normally would contain.
The original idea with this was, we would have this extra safeguard ensuring people didn't accidentally delete directories that contained important data unrelated to shinycannon. In practice though, it's just annoying.
Since the user is explicitly specifying --overwrite-output, we should assume they know what they're doing, and not confuse them with an error message.
There are two minor changes here that make interaction with the recording file and output directory more intuitive.
1. If the recording file doesn't exist, don't create the output directory.
Previously, even if the specified recording file didn't exist, an error was printed and
shinycannon
would exit. However, the output directory would still be created, and populated withdebug.log
if--debug-log
was specified.Shalu and I both found this counter-intuitive. It didn't make sense for an output directory to be created when there was no possible interesting output data to store.
Now, existence of the file is checked before any output directory or log files are created, and
shinycannon
exits immediately without creating any directories or files if the recording file doesn't exist.2. Respect
--overwrite-output
.Previously, even if
--overwrite-output
was specified -- indicating that the output directory should be deleted and recreated even it exists already --shinycannon
would still refuse to delete the output directory if it didn't contain files that an output directory normally would contain.The original idea with this was, we would have this extra safeguard ensuring people didn't accidentally delete directories that contained important data unrelated to shinycannon. In practice though, it's just annoying.
Since the user is explicitly specifying
--overwrite-output
, we should assume they know what they're doing, and not confuse them with an error message.