moving writeFile into try/catch

This commit is contained in:
Yotam Mann 2020-07-18 08:36:18 -07:00
parent 50d03787de
commit 55b555d25c

View file

@ -59,9 +59,9 @@ async function testExampleString(str) {
${str}
`;
const { path, cleanup } = await file({ postfix: ".ts" });
// work with file here in fd
await writeFile(path, str);
try {
// work with file here in fd
await writeFile(path, str);
await execPromise(`tsc --noEmit --target es5 --lib dom,ES2015 ${path}`);
} finally {
cleanup();