Just move the check inside `writeDeps` (e.g. `enforce(exe, "Executable location is not specified");`). The calls to it are conveniently located after the point where `exe` is calculated if `-of` or `-od` are set, but before the point where it is calculated if it's going to be in a temporary directory.