diff --git a/bin/generate.js b/bin/generate.js index 3b92db6..2167a3b 100755 --- a/bin/generate.js +++ b/bin/generate.js @@ -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); } } @@ -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`));