Skip to content

Loading…

Allow users to set VEEWEE_DIR env var to override #216

Closed
wants to merge 1 commit into from

2 participants

@mbbx6spp

Currently Veewee expects a directory structure to exist under the present working directory (PWD), but this is not how everyone would like to structure their project in their project root directory.

This is the simplest fix for those of us that wish to have our base box definitions under a subdirectory by setting VEEWEE_DIR environment variable to taste. I verified locally (by rake install, setting VEEWEE_DIR to a subdirectory with definitions dir and was able to run vagrant basebox list and related commands as expected).

I am open to adding unit tests for this, but I didn't find a test directory already existing. Let me know where to add my tests and I will do so then I can rebase/squash/force-push back for your to review and hopefully merge in.

@mbbx6spp mbbx6spp Allow users to set VEEWEE_DIR env var to override
Currently Veewee expects a directory structure to exist under
the present working directory (PWD), but this is not how everyone
would like to structure their project in their project root directory.

This is the simplest fix for those of us that wish to have our basebox
definitions under a subdirectory by defining VEEWEE_DIR as an environment
variable.
f113a2a
@jedi4ever
Owner

fixed in commit - c42a20a . Thanks for the inspiration!

@jedi4ever jedi4ever closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 30, 2012
  1. @mbbx6spp

    Allow users to set VEEWEE_DIR env var to override

    mbbx6spp committed
    Currently Veewee expects a directory structure to exist under
    the present working directory (PWD), but this is not how everyone
    would like to structure their project in their project root directory.
    
    This is the simplest fix for those of us that wish to have our basebox
    definitions under a subdirectory by defining VEEWEE_DIR as an environment
    variable.
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/veewee/command.rb
View
2 lib/veewee/command.rb
@@ -7,7 +7,7 @@
#Setup some base variables to use
template_dir=File.expand_path(File.join(lib_dir,"..", "templates"))
-veewee_dir="."
+veewee_dir=ENV['VEEWEE_DIR'] || "."
definition_dir= File.expand_path(File.join(veewee_dir, "definitions"))
tmp_dir=File.expand_path(File.join(veewee_dir, "tmp"))
iso_dir=File.expand_path(File.join(veewee_dir, "iso"))
Something went wrong with that request. Please try again.