hunk.code_window:     const config = new XI18nWebpackConfig({
         genDir,
         buildDir,
         i18nFormat: runTaskOptions.i18nFormat,
         locale: runTaskOptions.locale,
         outFile: runTaskOptions.outFile,
  
hunk.labels: keep replace replace keep keep keep
hunk.after_edit:       genDir: runTaskOptions.outputPath || appConfig.root,
         buildDir: '.tmp',
  
hunk.file_path: packages/@angular/cli/tasks/extract-i18n.ts
hunk.type: replace
file: 'use strict';
  
  var Promise = require('../ext/promise');
  var spawn = require('child_process').spawn;
  
  function openEditor(file) {
    if (!openEditor.canEdit()) {
      throw new Error('EDITOR environment variable is not set');
    }
  
    if (!file) {
      throw new Error('No `file` option provided');
    }
  
    var editorArgs  = openEditor._env().EDITOR.split(' ');
    var editor      = editorArgs.shift();
    var editProcess = openEditor._spawn(editor, [file].concat(editorArgs), {stdio: 'inherit'});
  
    return new Promise(function(resolve, reject) {
      editProcess.on('close', function (code) {
        if (code === 0) {
          resolve();
        } else {
          reject();
        }
      });
    });
  }
  
  openEditor.canEdit = function() {
    return openEditor._env().EDITOR !== undefined;
  };
  
  openEditor._env = function() {
    return process.env;
  };
  
  openEditor._spawn = function() {
    return spawn.apply(this, arguments);
  };
  
  module.exports = openEditor;
  