Skip to content

Commit

Permalink
quit with non-zero exit code if compilation fails
Browse files Browse the repository at this point in the history
  • Loading branch information
anton-trunov committed Feb 15, 2024
1 parent 381af2b commit b3dac33
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions scripts/prepare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,17 @@ import { __DANGER__disableVersionNumber } from '../src/pipeline/version';
__DANGER__disableVersionNumber();

// Compile projects
await run({ configPath: __dirname + '/../tact.config.json' });
if (!await run({ configPath: __dirname + '/../tact.config.json' })) {
console.error('Tact projects compilation failed');
process.exit(1);
}

// Verify projects
for (let pkgPath of glob.sync(path.normalize(path.resolve(__dirname, '..', 'examples', 'output', '*.pkg')))) {
let res = await verify({ pkg: fs.readFileSync(pkgPath, 'utf-8') });
if (!res.ok) {
console.warn('Failed to verify ' + pkgPath + ': ' + res.error);
console.error('Failed to verify ' + pkgPath + ': ' + res.error);
process.exit(1);
}
}

Expand Down Expand Up @@ -82,18 +86,18 @@ import { __DANGER__disableVersionNumber } from '../src/pipeline/version';
logger: consoleLogger
});
if (!c.ok) {
console.warn(c.log);
continue;
console.error(c.log);
process.exit(1);
}
} catch (e) {
console.warn(e);
console.warn('Failed');
continue;
console.error(e);
console.error('Failed');
process.exit(1);
}
fs.writeFileSync(p.path + r + ".fift", c.fift!);
fs.writeFileSync(p.path + r + ".cell", c.output!);

// Cell -> Fift decpmpiler
// Cell -> Fift decompiler
let source = decompileAll({ src: c.output! });
fs.writeFileSync(p.path + r + ".rev.fift", source);
}
Expand Down

0 comments on commit b3dac33

Please sign in to comment.