Skip to content

Commit 7967c6c

Browse files
committed
Parse angular.json as fallback during builder validation.
1 parent bfef257 commit 7967c6c

File tree

1 file changed

+8
-5
lines changed
  • packages/@apphosting/adapter-angular/src

1 file changed

+8
-5
lines changed

packages/@apphosting/adapter-angular/src/utils.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,14 @@ export async function checkBuildConditions(opts: BuildOptions): Promise<void> {
7676
if (value.extensions.projectType === "application") apps.push(key);
7777
});
7878
const project = apps[0];
79-
if (apps.length > 1 || !project) throw new Error(
80-
"Unable to determine the application to deploy");
79+
if (apps.length > 1 || !project) {
80+
throw new Error("Unable to determine the application to deploy");
81+
}
8182

8283
const workspaceProject = workspace.projects.get(project);
83-
if (!workspaceProject) throw new Error(`No project ${project} found.`);
84+
if (!workspaceProject) {
85+
throw new Error(`No project ${project} found.`);
86+
}
8487

8588
const target = "build";
8689
if (!workspaceProject.targets.has(target)) throw new Error("Could not find build target.");
@@ -104,12 +107,12 @@ export async function checkBuildConditions(opts: BuildOptions): Promise<void> {
104107
} catch (error) {
105108
logger.warn("failed to determine angular builder from parsing angular.json: ", error);
106109
}
107-
};
110+
}
108111

109112
if (angularBuilder !== "") {
110113
if (!ALLOWED_BUILDERS.includes(angularBuilder)) {
111114
throw new Error(
112-
`Currently, only the following builders are supported: ${ALLOWED_BUILDERS.join(",")}.`,
115+
`Currently, only the following builders are supported: ${ALLOWED_BUILDERS.join(",")}.`,
113116
);
114117
}
115118
}

0 commit comments

Comments
 (0)