[txmt-dev] Re: Problem with a patch in last alphas

Allan Odgaard mailinglist at textmate.org
Mon Jun 3 03:49:19 UTC 2013


On Jun 3, 2013, at 3:06, SalamanderMike <salamandermike at gmail.com> wrote:

> If I'm misunderstanding the issue or there is a simple way to change the
> default path back to the folder that contains the app, then please enlighten
> me!

Locate the Run command in the R bundle, e.g. open an R document and press ⌃⌘T + ⌘4 + ⌘R + ⌥↩ (Select Bundle Item followed by keyboard search (⌘4) for ⌘R and then “edit item”).

Then in the third line insert something like this:

echo cd "${TM_DIRECTORY:-${TM_PROJECT_DIRECTORY:-$HOME}}"

This will make your script’s working directory that of the current file, falling back on the project folder, and finally falling back on your home folder.

Be aware though that while it may seem like specifying relative paths in scripts is portable (to other systems) it is fragile, and you generally should have the script ensure that it sets the proper working directory or uses absolute paths (presumably resolved against the scripts path), see my previous reply about this.



More information about the textmate-dev mailing list