1

My .plist file calls a shell script but the script fails because it references other files in the same directory as the script.

Thus the script only runs successfully when I 'cd' to the correct folder.

How can I get the .plist to have this happen?

Ian Warburton
  • 319
  • 2
  • 4
  • 12

1 Answers1

1

Use WorkingDirectory option:

WorkingDirectory <string>

This optional key is used to specify a directory to chdir(2) to before running the job.

To see all available options, check launchd.plist manual page.

grekasius
  • 2,046
  • 11
  • 15