New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
--config option on commandline #676
Comments
It will also be necessary to specify the location of the |
IMHO a minimal implementation of this comprises these things:
It's actually already possible to do all three with the current nanoc (we use it successfully):
We wrap the relevant nanoc compile command in custom nanoc commands and rake tasks to set the right ENV variable beforehand. It works well actually, but it would be great if we can do it without monkey patching. |
So a --config option is one way to do it, but an --env option that gets picked up in the nanoc.yaml like rails does it may be even nicer, because there are a bunch of other things you may want to change based on the environment than just the directories. A few examples from our use case:
|
Agree with @Fjan on --env/-e option for specifying an environment name. Those options seem to be commonly used in many Ruby apps including compass which is used with Nanoc by many people. But then there needs to be a way to load the environment specific configuration. It would probably be best to always load The minimalist approach is just to run |
Instead of thinking in terms of solution, ie. |
What I currently is to have section like this in environments: development: config1: value1 .... confign: valuen test: ... production: ... and at the top of def set_environment envs = @config[:environments] || {} active = ENV.fetch "NANOC_ENVIRONMENT", 'development' puts "\n\n|====== ENV: #{active} ======\n\n" envs[active.to_sym].each do |k,v| @config[k] = v end end |
If Nanoc environments existed I would like them to support the following:
@ddfreyne are you working on it? Do you need help/support? |
With #859 being done, I feel that this issue can now be closed. |
Having a
--config
option on the command line will make it possible to have different environments.The text was updated successfully, but these errors were encountered: