MCPcopy Index your code
hub / github.com/angular/angularfire / getWorkspace

Function getWorkspace

src/schematics/utils.ts:30–53  ·  view source on GitHub ↗
(host: Tree)

Source from the content-addressed store, hash-verified

28export const shortAppId = (app?: FirebaseApp) => app?.appId?.split("/").pop();
29
30export function getWorkspace(host: Tree): {
31 path: string;
32 workspace: Workspace;
33} {
34 const path = "/angular.json";
35
36 const configBuffer = path && host.read(path);
37 if (!configBuffer) {
38 throw new SchematicsException(`Could not find angular.json`);
39 }
40
41 // eslint-disable-next-line @typescript-eslint/no-var-requires
42 const { parse } = require("jsonc-parser");
43
44 const workspace = parse(configBuffer.toString()) as Workspace | undefined;
45 if (!workspace) {
46 throw new SchematicsException("Could not parse angular.json");
47 }
48
49 return {
50 path,
51 workspace,
52 };
53}
54
55export const getProject = (options: DeployOptions, host: Tree) => {
56 const { workspace } = getWorkspace(host);

Callers 1

getProjectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected