From 9942380b0c0763937664e517e98a49771a6d706d Mon Sep 17 00:00:00 2001 From: monoid Date: Wed, 20 Apr 2022 17:11:45 +0900 Subject: [PATCH] feat: getIssue add path --- tools/getIssue.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/getIssue.ts b/tools/getIssue.ts index df574f5..56b1981 100644 --- a/tools/getIssue.ts +++ b/tools/getIssue.ts @@ -38,5 +38,11 @@ if (import.meta.main) { } const issues = await getIssues("vi117/scrap-yard", token); issues.sort((a, b) => a.number - b.number); - console.log(JSON.stringify(issues,undefined,2)); + const content = JSON.stringify(issues, null, 2); + if(typeof args.path === "string"){ + Deno.writeTextFileSync(args.path, content); + } + else{ + console.log(content); + } } \ No newline at end of file