Skip to content

Commit ac7438f

Browse files
bugfix
1 parent 9472667 commit ac7438f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/commands/init.mjs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
//@ts-check
22
/* eslint-disable require-atomic-updates */
3-
const __dirname = import.meta.dirname;
3+
import path from "node:path";
4+
import { fileURLToPath } from "node:url";
5+
const __filename = fileURLToPath(import.meta.url);
6+
const __dirname = path.dirname(__filename);
47

58
import * as inquirer from "@inquirer/prompts";
69
import fileSelector from "inquirer-file-selector";
@@ -124,6 +127,7 @@ async function getDatabaseRunnable(argv /*, priorChoices*/) {
124127

125128
buildCredentials({
126129
...argv,
130+
user: "default",
127131
database: runnable.choices.regionGroup,
128132
});
129133
runnable.fql = `Database.create({
@@ -289,11 +293,11 @@ async function getProjectRunnable(argv, priorChoices) {
289293
// new db with demo data? create the demo data, then upload the schema
290294
await Promise.all([
291295
fsp.cp(
292-
path.join(__dirname, "../lib/schema/demo-collection-schema.fsl"),
296+
path.join(__dirname, "../src/lib/schema/demo-collection-schema.fsl"),
293297
path.join(dirPath, dirName, "collections.fsl"),
294298
),
295299
fsp.cp(
296-
path.join(__dirname, "../lib/schema/demo-function-schema.fsl"),
300+
path.join(__dirname, "../src/lib/schema/demo-function-schema.fsl"),
297301
path.join(dirPath, dirName, "functions.fsl"),
298302
),
299303
]);

0 commit comments

Comments
 (0)