Home Download Buy Blog Forum Support

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

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

Postby vostok4 on Wed Jul 11, 2012 8:23 am

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.
vostok4
 
Posts: 25
Joined: Fri Oct 22, 2010 6:09 pm

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

Postby vostok4 on Thu Jul 12, 2012 1:16 am

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:

Code: Select all
"working_dir": "${file_path/src/./}"


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

Code: Select all
"working_dir": "${file_path/[^\/]*$//}"
vostok4
 
Posts: 25
Joined: Fri Oct 22, 2010 6:09 pm


Return to Technical Support

Who is online

Users browsing this forum: No registered users and 23 guests