project tasks and current-directory

View: New views
2 Messages — Rating Filter:   Alert me  

project tasks and current-directory

by Ittay Dror :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I'm creating tasks that are sensitive to the current directory. What I
see is that Dir.pwd is always the directory of buildfile, even when
running buildr from a subproject directory. Can I make buildr cd to the
directory of the project before the project tasks are invoked?

Thanks,
Ittay

--
--
Ittay Dror <ittay.dror@...>



Re: project tasks and current-directory

by Assaf Arkin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Jul 15, 2008 at 1:10 AM, Ittay Dror <ittay.dror@...> wrote:

> Hi,
>
> I'm creating tasks that are sensitive to the current directory. What I see
> is that Dir.pwd is always the directory of buildfile, even when running
> buildr from a subproject directory. Can I make buildr cd to the directory of
> the project before the project tasks are invoked?


Dir.chdir Buildr.application.original_dir do
 ...
end

Make sure to run all your code inside that block, so it can switch back to
the original directory afterwards.

Assaf


>
>
> Thanks,
> Ittay
>
> --
> --
> Ittay Dror <ittay.dror@...>
>
>
>
LightInTheBox - Buy quality products at wholesale price