Qt Creator: Run command before running executable?
-
I'd like to run a command (basically deleting a file) every time before I start a certain executable from Qt Creator (Run, not necessarily debug).
Is this possible with Qt Creator?
-
I'd like to run a command (basically deleting a file) every time before I start a certain executable from Qt Creator (Run, not necessarily debug).
Is this possible with Qt Creator?
@Asperamanca
I don't see where Creator allows a "pre-run" command, that would be nice.Can you utilise Specifying a Custom Executable to Run to perhaps execute a little script which deletes the file and then runs the real executable?
-
@Asperamanca
I don't see where Creator allows a "pre-run" command, that would be nice.Can you utilise Specifying a Custom Executable to Run to perhaps execute a little script which deletes the file and then runs the real executable?
@JonB
Thanks! It means a couple of extra clicks, but is still much faster than the alternatives I have used so far.
Thanks! -
-
@JonB
Thanks! It means a couple of extra clicks, but is still much faster than the alternatives I have used so far.
Thanks!@Asperamanca
An alternative might be to make your executable code itself delete such a file as the very first thing it does? You might even do that only if compiled with a certain#define
/command-line argument/environment variable setting? -
I'd like to run a command (basically deleting a file) every time before I start a certain executable from Qt Creator (Run, not necessarily debug).
Is this possible with Qt Creator?
@Asperamanca said in Qt Creator: Run command before running executable?:
basically deleting a file
What is that file? Is this a build artefact generated during the build?
-
@Asperamanca said in Qt Creator: Run command before running executable?:
basically deleting a file
What is that file? Is this a build artefact generated during the build?
@jsulm
In my case it's a file that the executable tries to parse, but fails. It's a bug, but it's another person's code, so I'd rather not change the code until it's properly fixed.