[c] Fix main module check

This commit is contained in:
Mario Zechner 2025-07-24 01:15:09 +02:00
parent 5c33aed9d6
commit 0d92c5d21e

View File

@ -83,7 +83,10 @@ async function main() {
console.log('Code generation complete!');
}
main().catch(error => {
console.error('Error:', error);
process.exit(1);
});
if (import.meta.url === `file://${process.argv[1]}`) {
// Run the main function if this file is executed directly
main().catch(error => {
console.error('Error during code generation:', error);
process.exit(1);
});
}