UNPKG

inklecate

Version:

A tiny wrapper around the desktop executables for ink's command-line Ink language compiler.

36 lines (31 loc) 675 B
const { unlink } = require('fs-extra'); module.exports = (args) => { const { compilerOutput, isCaching, outputFilepath, text, storyContent: fullStory, } = args; const storyContent = fullStory; return new Promise(async (resolve, reject) => { if (isCaching) { try { await unlink(outputFilepath); } catch (err) { if (err.code !== 'ENOENT') { return reject(err); } } } else { compilerOutput.forEach((item) => { console.log(item); }); } return resolve({ compilerOutput, storyContent, text, }); }); };