feat: getIssue add path

This commit is contained in:
monoid 2022-04-20 17:11:45 +09:00
parent 3e039e27a2
commit 9942380b0c

View File

@ -38,5 +38,11 @@ if (import.meta.main) {
} }
const issues = await getIssues("vi117/scrap-yard", token); const issues = await getIssues("vi117/scrap-yard", token);
issues.sort((a, b) => a.number - b.number); 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);
}
} }