| var fs = require('fs-extra'); | |
| function setEnvironment(configPath, environment) { | |
| fs.writeJson(configPath, {env: environment}, | |
| function (res) { | |
| console.log('Environment variable set to ' + environment) | |
| } | |
| ); | |
| } | |
| // Set environment variable to "test" | |
| setEnvironment('./config/env.json', 'test'); |