Skip to content

Commit 6ed7aef

Browse files
authored
fix(schematics): Fix ng add on Windows (#3022)
Need to convert the schematic host path to a windows path. Fixes #3016
1 parent bea9d67 commit 6ed7aef

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ jobs:
139139
matrix:
140140
os: [ ubuntu-latest ]
141141
node: ["14"]
142-
firebase: ["9", "canary"]
142+
firebase: ["9", "canary", "next"]
143143
firebaseTools: ["9"]
144144
rxjs: ["7"]
145145
ng: ["12", "next"]

src/schematics/setup/index.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { asWindowsPath, normalize } from '@angular-devkit/core';
12
import { SchematicContext, SchematicsException, Tree } from '@angular-devkit/schematics';
23
import {
34
getWorkspace, getProject, getFirebaseProjectNameFromHost, addEnvironmentEntry,
@@ -115,7 +116,8 @@ export const ngAddSetupProject = (
115116
) => async (host: Tree, context: SchematicContext) => {
116117

117118
// TODO is there a public API for this?
118-
const projectRoot: string = (host as any)._backend._root;
119+
let projectRoot: string = (host as any)._backend._root;
120+
if (process.platform.startsWith('win32')) { projectRoot = asWindowsPath(normalize(projectRoot)); }
119121

120122
const features = await featuresPrompt();
121123

0 commit comments

Comments
 (0)