Sublime Forum

Set working_dir to file's parent (without using projects)?

#1

How would I go about setting the working_dir directive in a build system to be the parent of the file dir I am currently in? Since the build system file is in JSON I’m not really sure what I can do in there.

0 Likes

#2

Well, I got it working. Since I know the path I want to eat is always the “/src” tail (ie turn /home/foo/blah/src into /home/foo/blah) I did the following:

"working_dir": "${file_path/src/./}"

However, a different regext didn’t seem to work, but I gave up trying to diagnose why:

"working_dir": "${file_path/^\/]*$//}"
0 Likes