CHEF-2398 : adding a cwd attr to the link resource


#1

Hi there,

I’ve written a simple implementation of a cwd attribute for the Link
resource.
it defaults to nil.
When loading the current resource, if cwd is an absolute link it
saves the current working dir then chdir(cwd)

at the end of both actions, it sets the working dir back if necessary.

I’ve added a requirement to Pathname so it can check for absolute
paths on the windows platform as well.

http://tickets.opscode.com/browse/CHEF-2389

I’m looking forward to your thougths and comments about it :slight_smile:


Laurent


#2

Could you explain why this is useful? I haven’t used them in ages, so I can’t remember what they’re good for (besides surprising me).

In particular, I have no idea what the example in the ticket is supposed to do.


josephholsten.com

On Saturday, April 14, 2012 at 22:25, Laurent Desarmes wrote:

Hi there,

I’ve written a simple implementation of a cwd attribute for the Link
resource.
it defaults to nil.
When loading the current resource, if cwd is an absolute link it
saves the current working dir then chdir(cwd)

at the end of both actions, it sets the working dir back if necessary.

I’ve added a requirement to Pathname so it can check for absolute
paths on the windows platform as well.

http://tickets.opscode.com/browse/CHEF-2389

I’m looking forward to your thougths and comments about it :slight_smile:


Laurent