Created
June 7, 2012 18:01
-
-
Save possibilities/2890457 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new Demo({ | |
hosts: { | |
production: ['forms.meteor.com'] | |
}, | |
github: { | |
user: 'possibilities', | |
repo: 'meteor-forms' | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Demo.prototype._establishEnv = function() { | |
Meteor.env || (Meteor.env = {}); | |
if (Meteor.is_client) { | |
if (this.hosts && this.hosts.production) { | |
var isProductionHost = _.contains(this.hosts.production, window.location.hostname); | |
Meteor.env.is_development = !isProductionHost; | |
Meteor.env.is_production = isProductionHost; | |
} else { | |
return console.log("You have to provide a list of production hosts for this to work on the client!"); | |
} | |
} else { | |
var path = __meteor_bootstrap__.require('path'); | |
var pathToConfig = process.env.HOME + '/.meteor.cfg'; | |
var configExists = path.existsSync(pathToConfig); | |
Meteor.env.is_development = configExists; | |
Meteor.env.is_production = !configExists; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment