Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions packages/evidence/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ const buildHelper = function (command, args) {
const flatArgs = flattenArguments(args);

const dataDir = process.env.EVIDENCE_DATA_DIR ?? './static/data';
const outDir = process.env.EVIDENCE_OUT_DIR ?? '.evidence/template/build';

// Run svelte kit build in the hidden directory
const child = spawn(command, flatArgs, {
Expand All @@ -182,7 +183,6 @@ const buildHelper = function (command, args) {
});
// Copy the outputs to the root of the project upon successful exit
child.on('exit', function (code) {
const outDir = '.evidence/template/build';
if (code === 0) {
const staticlessDataDir = removeStaticDir(dataDir);
const buildDataDir = path.join(outDir, staticlessDataDir);
Expand Down Expand Up @@ -217,8 +217,10 @@ const buildHelper = function (command, args) {
fs.writeJsonSync(manifestFile, manifest);
}

fs.copySync(outDir, './build');
console.log(`Build complete --> ${process.env.EVIDENCE_BUILD_DIR ?? './build'} `);
const buildDest = process.env.EVIDENCE_BUILD_DIR ?? './build';

fs.copySync(outDir, buildDest);
console.log(`Build complete --> ${buildDest} `);
} else {
console.error('Build failed');
}
Expand Down
Loading