Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I set up the "Working Directory:" from the "External Tools Configuration..." in Eclipse?

When I open a source file from my project and I run a custom build script, I want the working directory to initialise to the actual current working directory from which the source file was opened. Any idea how to do this?

UPDATE: Also, how can I set the "Working Directory" to one level above the actual working directory?

like image 572
citn Avatar asked Oct 14 '22 13:10

citn


1 Answers

I'm not sure I understand exactly what you're after, but there are a number of variables that can be used in External launch configurations.

From your description, the likely one is to put ${resource_loc} in the Working Directory: field.

From the description:

Returns the absolute file system path of a resource. The target resource is the selected resource when no argument is specified, or the resource identified by a workspace relative path.

Alternatively, ${container_loc} might be more appropriate if you need to run on a directory:

Returns the absolute file system path of a resource's container. The target resource is the selected resource when no argument is specified, or the resource identified by a workspace relative path.

like image 145
Rich Seller Avatar answered Oct 20 '22 16:10

Rich Seller