Skip to content

Commit d746051

Browse files
alan-agius4vikerman
authored andcommitted
fix(@angular/cli): log file path normalization
In windows the logfile path in the console will be printed with both back and forward slashes if not normalized.
1 parent a5afd7b commit d746051

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/angular/cli/lib/cli/index.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88
import { createConsoleLogger } from '@angular-devkit/core/node';
9+
import { normalize } from 'path';
910
import { format } from 'util';
1011
import { runCommand } from '../../models/command-runner';
1112
import { colors, supportsColor } from '../../utilities/color';
@@ -65,7 +66,7 @@ export default async function(options: { testing?: boolean; cliArgs: string[] })
6566
const fs = await import('fs');
6667
const os = await import('os');
6768
const tempDirectory = fs.mkdtempSync(fs.realpathSync(os.tmpdir()) + '/' + 'ng-');
68-
const logPath = tempDirectory + '/angular-errors.log';
69+
const logPath = normalize(tempDirectory + '/angular-errors.log');
6970
fs.appendFileSync(logPath, '[error] ' + (err.stack || err));
7071

7172
logger.fatal(

0 commit comments

Comments
 (0)