josephbergevin / codebook-md

Bring your markdown to life with this VS Code extension. Execute code blocks at the click of a button in a notebook style similar to Jupyter. GitHub permalinks will show a preview and can be clicked to navigate to the file/line locally.
MIT License
0 stars 0 forks source link

Implement deleteExecFileOnSuccess in kernel #15

Open josephbergevin opened 1 month ago

josephbergevin commented 1 month ago

https://github.com/josephbergevin/codebook-md/blob/5ebb4089a05705d4c6d359a6d3c3e117d2c74ddf/package.json#L64-L68

josephbergevin commented 1 month ago

Implement in kernel.ts:

output.on('close', (_) => {
    // If stdout returned anything consider it a success
    if (buf.length === 0) {
        exec.end(false, (new Date).getTime());
    } else {
        exec.end(true, (new Date).getTime());
    }
});