Skip to content

Commit fa3ceaf

Browse files
authored
@edgedb/create: add auth extension regardless of initializeProject setting (#863)
1 parent 642a139 commit fa3ceaf

File tree

1 file changed

+16
-12
lines changed
  • packages/create/src/recipes/_edgedb

1 file changed

+16
-12
lines changed

packages/create/src/recipes/_edgedb/index.ts

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ const recipe: Recipe<EdgeDBOptions> = {
109109
await copyTemplateFiles(path.resolve(dirname, "./template"), projectDir);
110110
}
111111

112-
if (useEdgeDBAuth && initializeProject) {
112+
if (useEdgeDBAuth) {
113113
logger("Adding auth extension to project");
114114

115115
spinner.start("Enabling auth extension in EdgeDB schema");
@@ -118,17 +118,21 @@ const recipe: Recipe<EdgeDBOptions> = {
118118
await fs.writeFile(filePath, `using extension auth;\n\n${data}`);
119119
spinner.stop("Auth extension enabled in EdgeDB schema");
120120

121-
logger("Creating and applying initial migration");
122-
spinner.start("Creating and applying initial migration");
123-
try {
124-
await execInLoginShell("edgedb migration create", { cwd: projectDir });
125-
await execInLoginShell("edgedb migrate", { cwd: projectDir });
126-
spinner.stop("Initial migration created and applied");
127-
} catch (error) {
128-
logger(error);
129-
throw error;
130-
} finally {
131-
spinner.stop();
121+
if (initializeProject) {
122+
logger("Creating and applying initial migration");
123+
spinner.start("Creating and applying initial migration");
124+
try {
125+
await execInLoginShell("edgedb migration create", {
126+
cwd: projectDir,
127+
});
128+
await execInLoginShell("edgedb migrate", { cwd: projectDir });
129+
spinner.stop("Initial migration created and applied");
130+
} catch (error) {
131+
logger(error);
132+
throw error;
133+
} finally {
134+
spinner.stop();
135+
}
132136
}
133137
}
134138
},

0 commit comments

Comments
 (0)