hunk.code_window: Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
   Before running the tests make sure you are serving the app via `ng serve`.
   ## Deploying to Github Pages
  
hunk.labels: keep keep keep keep replace keep
hunk.after_edit: ## Deploying to GitHub Pages
  
hunk.file_path: packages/angular-cli/blueprints/ng2/files/README.md
hunk.type: replace
file: #!/usr/bin/env node
  'use strict';
  
  // Provide a title to the process in `ps`
  process.title = 'angular-cli';
  
  const resolve = require('resolve');
  const packageJson = require('../package.json');
  const Version = require('../upgrade/version').Version;
  const yellow = require('chalk').yellow;
  const SemVer = require('semver').SemVer;
  const fs = require('fs');
  const path = require('path');
  
  
  function _fromPackageJson(cwd) {
    cwd = cwd || process.cwd();
  
    do {
      const packageJsonPath = path.join(cwd, 'node_modules/angular-cli/package.json');
      if (fs.existsSync(packageJsonPath)) {
        const content = fs.readFileSync(packageJsonPath, 'utf-8');
        if (content) {
          const json = JSON.parse(content);
          if (json['version']) {
            return new SemVer(json['version']);
          }
        }
      }
  
      // Check the parent.
      cwd = path.dirname(cwd);
    } while (cwd != path.dirname(cwd));
  
    return null;
  }
  
  
  // Check if we need to profile this CLI run.
  let profiler = null;
  if (process.env['NG_CLI_PROFILING']) {
    profiler = require('v8-profiler');
    profiler.startProfiling();
    function exitHandler(options, err) {
      if (options.cleanup) {
        const cpuProfile = profiler.stopProfiling();
        fs.writeFileSync(path.resolve(process.cwd(), process.env.NG_CLI_PROFILING) + '.cpuprofile',
          JSON.stringify(cpuProfile));
      }
  
      if (options.exit) {
        process.exit();
      }
    }
  
    process.on('exit', exitHandler.bind(null, { cleanup: true }));
    process.on('SIGINT', exitHandler.bind(null, { exit: true }));
    process.on('uncaughtException', exitHandler.bind(null, { exit: true }));
  }
  
  
  resolve('angular-cli', { basedir: process.cwd() },
    function (error, projectLocalCli) {
      var cli;
      if (error) {
        // If there is an error, resolve could not find the ng-cli
        // library from a package.json. Instead, include it from a relative
        // path to this script file (which is likely a globally installed
        // npm package). Most common cause for hitting this is `ng new`
        cli = require('../lib/cli');
      } else {
        // Verify that package's version.
        Version.assertPostWebpackVersion();
  
        // This was run from a global, check local version.
        const globalVersion = new SemVer(packageJson['version']);
        let localVersion;
        let shouldWarn = false;
  
        try {
          localVersion = _fromPackageJson();
          shouldWarn = localVersion && globalVersion.compare(localVersion) < 0;
        } catch (e) {
          console.error(e);
          shouldWarn = true;
        }
  
        if (shouldWarn) {
          // eslint-disable no-console
          console.log(yellow(`Your global Angular CLI version (${globalVersion}) is greater than `
            + `your local version (${localVersion}). The local Angular CLI version is used.`));
        }
  
        // No error implies a projectLocalCli, which will load whatever
        // version of ng-cli you have installed in a local package.json
        cli = require(projectLocalCli);
      }
  
      if ('default' in cli) {
        cli = cli['default'];
      }
  
      cli({
        cliArgs: process.argv.slice(2),
        inputStream: process.stdin,
        outputStream: process.stdout
      }).then(function (result) {
        process.exit(typeof result === 'object' ? result.exitCode : result);
      });
    });
  