Skip to content

Commit 5ccf5db

Browse files
alan-agius4jamesdaniels
authored andcommitted
fix(schematics): fix issues with FS and Devkit Paths (#2279)
Angular devkit paths are not interchangeable with Node FS paths. Closes #2088
1 parent f3b7bd8 commit 5ccf5db

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/schematics/deploy/builder.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import {
55
} from "@angular-devkit/architect";
66
import { NodeJsSyncHost } from "@angular-devkit/core/node";
77
import deploy from "./actions";
8-
import { experimental, join, normalize } from "@angular-devkit/core";
8+
import { experimental, normalize } from "@angular-devkit/core";
9+
import * as path from "path";
910
import { getFirebaseProjectName } from "../utils";
1011

1112
// Call the createBuilder() function to create a builder. This mirrors
@@ -29,15 +30,15 @@ export default createBuilder<any>(
2930
const project = workspace.getProject(context.target.project);
3031

3132
const firebaseProject = getFirebaseProjectName(
32-
workspace.root,
33+
context.workspaceRoot,
3334
context.target.project
3435
);
3536

3637
try {
3738
await deploy(
3839
require("firebase-tools"),
3940
context,
40-
join(workspace.root, project.root),
41+
path.join(context.workspaceRoot, project.root),
4142
firebaseProject
4243
);
4344
} catch (e) {

src/schematics/utils.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ export const projectPrompt = (projects: Project[]) => {
5757
};
5858

5959
export function getFirebaseProjectName(
60-
projectRoot: string,
60+
workspaceRoot: string,
6161
target: string
6262
): string | undefined {
6363
const { targets }: FirebaseRc = JSON.parse(
64-
readFileSync(join(projectRoot, ".firebaserc"), "UTF-8")
64+
readFileSync(join(workspaceRoot, ".firebaserc"), "UTF-8")
6565
);
6666
const projects = Object.keys(targets!);
6767
return projects.find(

0 commit comments

Comments
 (0)