From 795fb0eb60ea475533b1d9a12182030f93f01cac Mon Sep 17 00:00:00 2001 From: tamaina Date: Fri, 3 Apr 2020 17:13:41 +0900 Subject: Pre-render ReDoc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit redoc-cliはexpandResponsesは200のみとすると数値と認識されてしまい設定できないため202,204という指定にしています --- src/tools/refresh-question.ts | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'src/tools/refresh-question.ts') diff --git a/src/tools/refresh-question.ts b/src/tools/refresh-question.ts index 83d71ff303..5104590bf4 100644 --- a/src/tools/refresh-question.ts +++ b/src/tools/refresh-question.ts @@ -4,11 +4,15 @@ async function main(uri: string): Promise { return await updateQuestion(uri); } -const args = process.argv.slice(2); -const uri = args[0]; - -main(uri).then(result => { - console.log(`Done: ${result}`); -}).catch(e => { - console.warn(e); -}); +export default () => { + const args = process.argv.slice(3); + const uri = args[0]; + + main(uri).then(result => { + console.log(`Done: ${result}`); + process.exit(0); + }).catch(e => { + console.warn(e); + process.exit(1); + }); +} -- cgit v1.2.3-freya