ember-cli-s3-sync
Advanced tools
Comparing version 0.0.11 to 0.0.12-beta.1
@@ -110,11 +110,35 @@ 'use strict'; | ||
var productionConfig = { | ||
environment: 'production', | ||
options: developmentConfig.options | ||
}; | ||
var configs: { | ||
development: developmentConfig, | ||
production: productionConfig | ||
}; | ||
/** | ||
* | ||
* `--environment` argument gets passed in as `env`. | ||
* Default is 'development' | ||
* | ||
*/ | ||
module.exports = function(env) { | ||
env = env || 'development'; | ||
return (env === 'development') ? developmentConfig : productionConfig; | ||
config param takes precedence over environment. | ||
@method configFile | ||
@params {String} config Comes from --config | ||
@params {String} environment Comes from --environment | ||
*/ | ||
module.exports = function configFile(name, environment) { | ||
var configuration; | ||
if (name) { | ||
configuration = configs[name]; | ||
} | ||
if (!configuration && environment) { | ||
for (var key in configs) { | ||
if (config[key]['environment'] === environment) { | ||
configuration = config[key]; | ||
} | ||
} | ||
} | ||
return configuration; | ||
} |
@@ -21,4 +21,6 @@ 'use strict'; | ||
availableOptions: [ | ||
{ name: 'environment', type: String, default: 'development' }, | ||
{ name: 'output-path', type: path, default: 'dist/' }, | ||
{ name: 'config', type: String, default: '', aliases: ['c'] }, | ||
{ name: 'environment', type: String, default: '', aliases: ['e'] }, | ||
{ name: 'output-path', type: path, default: 'dist/', aliases: ['o'] }, | ||
{ name: 'prepend-path', type: String, default: '', aliases: ['p'] }, | ||
{ name: 'skip-build', type: Boolean, default: false }, | ||
@@ -28,4 +30,3 @@ { name: 'aws-key', type: String }, | ||
{ name: 'aws-bucket', type: String }, | ||
{ name: 'aws-region', type: String }, | ||
{ name: 'prepend-path', type: String, default: '' } | ||
{ name: 'aws-region', type: String } | ||
], | ||
@@ -37,7 +38,8 @@ | ||
process.env.EMBER_ENV = this.environment = options.environment; | ||
this.configFile = this.config(this.environment); | ||
this.configFile = this.config(options.config, options.environment); | ||
this.setProcessEnvs(this.environment); | ||
process.env.EMBER_ENV = options.environment || this.configFile.environment; | ||
this.setProcessEnvs(this.configFile.processEnv); | ||
return this.build(options) | ||
@@ -114,4 +116,4 @@ .then(function() { | ||
setProcessEnvs: function(environment) { | ||
var variables = this.config(environment).processEnv || {} | ||
setProcessEnvs: function(variables) { | ||
variables = variables || {} | ||
@@ -118,0 +120,0 @@ for (var key in variables) { |
{ | ||
"name": "ember-cli-s3-sync", | ||
"version": "0.0.11", | ||
"version": "0.0.12-beta.1", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "directories": { |
61912
1453