Skip to content

Changing target_dir based on env ? #525

Answered by DannyBen
codevogel asked this question in Q&A
Discussion options

You must be logged in to vote

Well, no there is not really an option like this. Keep in mind that the target_dir in the settings is not only for the final script, it is used by other things as well.

Things to consider:

  1. There should normally not be a need to generate both versions. Choose one that is best for you and stay with it.
  2. You can use ERB in the settings.yml, so you can do something like this
    target_dir: <%= ENV['BASHLY_ENV'] == 'production' ? '.' : 'dev' %>
  3. Keep in mind that running bashly generate --env production does not change the BASHLY_ENV environment variable, so you might need to run something like BASHLY_ENV=production bashly g
  4. Any setting in the settings.yml file can be overridden via environment v…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@codevogel
Comment options

Answer selected by codevogel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants