Skip to content

Commit

Permalink
fix(schematics): Fix ng add on Windows (#3022)
Browse files Browse the repository at this point in the history
Need to convert the schematic host path to a windows path. Fixes #3016
  • Loading branch information
jamesdaniels authored Oct 14, 2021
1 parent bea9d67 commit 6ed7aef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
4 changes: 3 additions & 1 deletion src/schematics/setup/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { asWindowsPath, normalize } from '@angular-devkit/core';
import { SchematicContext, SchematicsException, Tree } from '@angular-devkit/schematics';
import {
getWorkspace, getProject, getFirebaseProjectNameFromHost, addEnvironmentEntry,
Expand Down Expand Up @@ -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();

Expand Down

0 comments on commit 6ed7aef

Please sign in to comment.