var fs = require('fs');
function main (){
  var args = process.argv.splice(2)
  if (args.length !== 1) {
    return console.log('参数请填写环境变量');
  }
  let env = args[0];

  let configObject = {
      env: env
  };
  let result = JSON.stringify(configObject);

  fs.writeFileSync(__dirname + '/game-server/config.json', result, 'utf8');
  fs.writeFileSync(__dirname + '/gm-server/config/env', env, 'utf8');
  fs.writeFileSync(__dirname + '/web-server/config/env', env, 'utf8');
}

main();
