From 9e733f03767d5ac7faf1472820c934985d458c23 Mon Sep 17 00:00:00 2001 From: Seokseong Jeon Date: Tue, 27 Jul 2021 15:33:06 +0900 Subject: [PATCH] Add logging --- dist/index.js | 3 ++- dist/index.js.map | 2 +- src/index.ts | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/dist/index.js b/dist/index.js index 837ac7c..6887c91 100644 --- a/dist/index.js +++ b/dist/index.js @@ -34,10 +34,11 @@ try { var gh_1 = new octokit_1.Octokit({ auth: token }); var hexo_2 = new hexo_1.default(process.cwd(), {}); hexo_2.init().then(function () { + console.log("Converting issue " + endpoint_1 + " to Hexo post..."); gh_1.request("GET " + endpoint_1).then(function (response) { var _a = response.data, title = _a.title, date = _a.updated_at, labels = _a.labels, milestone = _a.milestone, content = _a.body; if (milestone.title !== MILESTONE_PUBLISH) { - console.log("Issue " + endpoint_1 + " does not have milestone " + MILESTONE_PUBLISH); + console.log("Issue does not have milestone " + MILESTONE_PUBLISH); } else { var tags = labels.map(function (label) { return label.name; }); diff --git a/dist/index.js.map b/dist/index.js.map index 508d069..9837881 100644 --- a/dist/index.js.map +++ b/dist/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAAsC;AACtC,mCAAkC;AAClC,8CAAwB;AAExB,IAAM,iBAAiB,GAAG,SAAS,CAAC;AAEpC,IAAI;IACA,IAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IAC5C,IAAM,KAAK,GAAG,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACzC,IAAM,UAAQ,GAAG,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC3C,IAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IAErC,IAAM,IAAE,GAAG,IAAI,iBAAO,CAAC,EAAE,I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,CAAC,CAAC,CAAC,KAAK,CAAC,UAAC,MAAM;YACZ,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAC3B,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC,KAAK,CAAC,UAAC,MAAM;QACZ,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAC3B,CAAC,CAAC,CAAC;CACN;AAAC,OAAO,CAAC,EAAE;IACR,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;CACrB"} \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 3b3f66e..49420fd 100644 --- a/src/index.ts +++ b/src/index.ts @@ -14,10 +14,11 @@ try { const hexo = new Hexo(process.cwd(), {}); hexo.init().then(() => { + console.log(`Converting issue ${endpoint} to Hexo post...`); gh.request(`GET ${endpoint}`).then((response) => { const { title, updated_at: date, labels, milestone, body: content } = response.data; if (milestone.title !== MILESTONE_PUBLISH) { - console.log(`Issue ${endpoint} does not have milestone ${MILESTONE_PUBLISH}`); + console.log(`Issue does not have milestone ${MILESTONE_PUBLISH}`); } else { const tags = labels.map((label: any) => label.name); hexo.post.create({