jonlives / knife-spork

A workflow plugin to help many devs work with cookbooks and environments at once
Other
335 stars 97 forks source link

having 'cookbook' in the parent directories causes a failure #137

Closed jperry closed 10 years ago

jperry commented 10 years ago

Hey @jonlives,

Seeing this failure when I have 'cookbook' in my parent directory path.

master [08:52:28] ~/workspace/bithub/cookbooks-org/chef > be knife spork promote qa base
Adding version constraint base = 4.0.1
Saving changes to qa.json
ERROR: Errno::ENOENT: No such file or directory @ rb_sysopen - /Users/jperry/workspace/bithub/environments-org/chef/environments/qa.json
jonlives commented 10 years ago

@jperry could you gist the output of running that with the -VV option please?

jonlives commented 10 years ago

@jperry ah I think I know what's going on - spork gsubs "cookbooks" with "environments" to look for environment files, it doesn't account for that occurring earlier in the path than the last position. Thanks for the report, I'll add this to the list to fix for the next release (hopefully next week)

jonlives commented 10 years ago

@jperry as a temporary fix, you could set the "environment_path" config option, which takes precedence over that gsub. https://github.com/jonlives/knife-spork#environment-path

jperry commented 10 years ago

Thanks @jonlives . The environment_path fixed the issue.

jperry commented 10 years ago

Thanks!