From 6ed7aef4c614dc1a776689f6a78bbc10594d1851 Mon Sep 17 00:00:00 2001 From: James Daniels Date: Thu, 14 Oct 2021 01:09:16 -0400 Subject: [PATCH] fix(schematics): Fix ng add on Windows (#3022) Need to convert the schematic host path to a windows path. Fixes #3016 --- .github/workflows/test.yml | 2 +- src/schematics/setup/index.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4c45c1ef6..a34d0a099 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -139,7 +139,7 @@ jobs: matrix: os: [ ubuntu-latest ] node: ["14"] - firebase: ["9", "canary"] + firebase: ["9", "canary", "next"] firebaseTools: ["9"] rxjs: ["7"] ng: ["12", "next"] diff --git a/src/schematics/setup/index.ts b/src/schematics/setup/index.ts index 3f7341e34..2b4323c7f 100644 --- a/src/schematics/setup/index.ts +++ b/src/schematics/setup/index.ts @@ -1,3 +1,4 @@ +import { asWindowsPath, normalize } from '@angular-devkit/core'; import { SchematicContext, SchematicsException, Tree } from '@angular-devkit/schematics'; import { getWorkspace, getProject, getFirebaseProjectNameFromHost, addEnvironmentEntry, @@ -115,7 +116,8 @@ export const ngAddSetupProject = ( ) => async (host: Tree, context: SchematicContext) => { // TODO is there a public API for this? - const projectRoot: string = (host as any)._backend._root; + let projectRoot: string = (host as any)._backend._root; + if (process.platform.startsWith('win32')) { projectRoot = asWindowsPath(normalize(projectRoot)); } const features = await featuresPrompt();