Skip to content

Commit

Permalink
fix(@angular/cli): fix PWD in cygwin
Browse files Browse the repository at this point in the history
Fix #10232
  • Loading branch information
filipesilva authored and hansl committed May 10, 2018
1 parent 325baa6 commit b9c40ee
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 9 deletions.
5 changes: 0 additions & 5 deletions packages/@angular/cli/lib/cli/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as path from 'path';
import { filter } from 'rxjs/operators';
import { logging, terminal } from '@angular-devkit/core';
import { runCommand } from '../../models/command-runner';
Expand Down Expand Up @@ -41,10 +40,6 @@ function loadCommands() {
}

export default async function(options: any) {
// ensure the environemnt variable for dynamic paths
process.env.PWD = path.normalize(process.env.PWD || process.cwd());
process.env.CLI_ROOT = process.env.CLI_ROOT || path.resolve(__dirname, '..', '..');

const commands = loadCommands();

const logger = new logging.IndentLogger('cling');
Expand Down
3 changes: 1 addition & 2 deletions packages/@angular/cli/models/schematic-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ export abstract class SchematicCommand extends Command {
},
);

const cwd = process.env.PWD;
const workingDir = cwd.replace(this.project.root, '').replace(/\\/g, '/');
const workingDir = process.cwd().replace(this.project.root, '').replace(/\\/g, '/');
const pathOptions = this.setPathOptions(schematicOptions, workingDir);
schematicOptions = { ...schematicOptions, ...pathOptions };
const defaultOptions = this.readDefaults(collectionName, schematicName, schematicOptions);
Expand Down
2 changes: 0 additions & 2 deletions tests/e2e/utils/process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,6 @@ export function execAndWaitForOutputToMatch(cmd: string, args: string[], match:

let npmInstalledEject = false;
export function ng(...args: string[]) {
process.env.PWD = process.cwd();

const argv = getGlobalVariable('argv');
const maybeSilentNg = argv['nosilent'] ? noSilentNg : silentNg;
if (['build', 'serve', 'test', 'e2e', 'xi18n'].indexOf(args[0]) != -1) {
Expand Down

0 comments on commit b9c40ee

Please sign in to comment.