Skip to content

Commit

Permalink
Working on workflow...
Browse files Browse the repository at this point in the history
  • Loading branch information
iLiftALot committed Nov 13, 2024
1 parent 0ed3fdc commit 4e8f100
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 430 deletions.
29 changes: 15 additions & 14 deletions esbuild.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -152,24 +152,25 @@ const context = await esbuild.context({
process.exit(1);
})

try {
//symlinkSync(sourcePath, targetPath);
//logs.push(`Symlink created: ${targetPath} -> ${sourcePath}`);

// Copy the file instead of creating a symlink
copyFileSync(sourcePath, targetPath);
logs.push(`Copied file: ${sourcePath} -> ${targetPath}`);
} catch (error) {
console.error(`Error creating symlink: ${error}\nLogs:\n${logs.join('\n')}`);
process.exit(1);
function copyMainJs() {
try {
// Copy the file instead of creating a symlink
copyFileSync(sourcePath, targetPath);
logs.push(`Copied file: ${sourcePath} -> ${targetPath}`);

logs = logs.join('\n');
if (shouldLog) console.log(logs);
} catch (error) {
console.error(`Error creating symlink: ${error}\nLogs:\n${logs.join('\n')}`);
process.exit(1);
}
}

logs = logs.join('\n');
if (shouldLog) console.log(logs);

if (prod) {
await context.rebuild();
process.exit(0);
copyMainJs();
await context.dispose();
} else {
copyMainJs();
await context.watch();
}
Loading

0 comments on commit 4e8f100

Please sign in to comment.