I am using os.execute in a Lua script in darktable. If I run darktable from a terminal, like when you run it in debug mode, the os.execute line will pause and wait for the execution of the command. After finishing, it will return the result to Lua and the program goes on.
The problem I have is that even though it works in debug mode, when I run Darktable straight from the OS, the program fails. The os.execute will not wait for a return and fail straight way.
I have checked on Activity Monitor and in both cases the program is being run by the same user, so it. should not be a user problem.
Any ideas?
Upun further inspection I saw it exited with code 127 which is command not found. The command I am using is exiftool and in terminal I can use it straight away, I did a which exiftool to get the full path, and entered the full path in the script. Now it works! But still would like to know WHY…?