Skip to content

Commit

Permalink
build folder doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
simonvbrae committed Nov 29, 2024
1 parent f0d32c6 commit 2632999
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions bin/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ if (args.h || args.help || args._.length > 1) {
for (const entry of webpackConfig) {
entry.mode = mode;
if (entry.output) {
console.log("sending to");
console.log(path.resolve(process.cwd(), destinationPath));
entry.output.path = path.resolve(process.cwd(), destinationPath);
}
}
Expand All @@ -88,25 +90,11 @@ if (args.h || args.help || args._.length > 1) {
});

if (fs.existsSync(path.join(process.cwd(), 'queries.json'))) {
// Debug the difference between path.resolve and path.join on different systems in the CI
// Most likely build/ doesn't exist
console.log("path.resolve(process.cwd(), `${destinationPath}/queries.json`)");
console.log(path.resolve(process.cwd(), `${destinationPath}/queries.json`));
console.log("path.join(process.cwd(), `${destinationPath}/queries.json`)");
console.log(path.join(process.cwd(), `${destinationPath}/queries.json`));
// build folder doesn't exist
if (! fs.existsSync(path.resolve(process.cwd(), destinationPath))) {
console.log("resolve destinationPath doesn't exist");
console.log("CREATE");
console.log("CREATING resolve destinationPath");
fs.mkdirSync(path.resolve(process.cwd(), destinationPath));
} else {
console.log("resolve destinationPath exists");
}
if (! fs.existsSync(path.join(process.cwd(), destinationPath))) {
console.log("join destinationPath doesn't exist");
console.log("CREATE");
fs.mkdirSync(path.join(process.cwd(), destinationPath));
} else {
console.log("join destinationPath exists");
}

fs.renameSync(path.join(process.cwd(), 'queries.json'), path.resolve(process.cwd(), `${destinationPath}/queries.json`));
Expand Down

0 comments on commit 2632999

Please sign in to comment.