From a9f54ea488ba6afbaedb6c04b1fd1c802a07c640 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristj=C3=A1n=20Oddsson?= Date: Thu, 19 Mar 2020 13:58:21 +0000 Subject: [PATCH] move try catch into async function --- bin/github-lint.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/bin/github-lint.js b/bin/github-lint.js index 916d4f68..76f8df21 100755 --- a/bin/github-lint.js +++ b/bin/github-lint.js @@ -17,8 +17,8 @@ function execFile(command, args) { }) } -try { - ;(async function() { +;(async function() { + try { let runs = 0 const codes = [] const commands = [] @@ -58,9 +58,9 @@ try { process.stderr.write(`\nCommand failed: ${nonzero}\n`) process.exit(nonzero) } - })() -} catch (error) { - setTimeout(() => { - throw error - }) -} + } catch (error) { + setTimeout(() => { + throw error + }) + } +})()