Skip to content

Commit

Permalink
ensures posix path separators are used in package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
ymc9 committed Jul 27, 2024
1 parent 57af81d commit 6d96425
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/misc/redwood/src/commands/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ function bootstrapSchema() {
const pkg = JSON.parse(content);
if (!pkg.zenstack) {
pkg.zenstack = {
schema: path.relative(apiPaths.base, zmodel),
prisma: path.relative(apiPaths.base, apiPaths.dbSchema),
schema: normalizePath(path.relative(apiPaths.base, zmodel)),
prisma: normalizePath(path.relative(apiPaths.base, apiPaths.dbSchema)),
};
fs.writeFileSync(pkgJson, JSON.stringify(pkg, null, 4));
}
Expand All @@ -58,6 +58,11 @@ function bootstrapSchema() {
};
}

// ensures posix path separators are used in package.json
function normalizePath(_path: string) {
return _path.replaceAll(path.sep, path.posix.sep);
}

// install ZenStack GraphQLYoga plugin
function installGraphQLPlugin() {
return {
Expand Down

0 comments on commit 6d96425

Please sign in to comment.