Skip to content

Commit

Permalink
fix text format (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
ttymsd authored Apr 21, 2021
1 parent 2c8852c commit ed586fb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
8 changes: 4 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ function createWrikeTask(config, issue, crashlyticsBaseUrl) {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, axiosClient.post("/folders/" + config.folderId + "/tasks", {
"title": issue.title,
"description": "" + crashlyticsBaseUrl + issue.id + "\n\n ",
"title": issue.exceptionType + "(" + issue.exceptionMessage + ") " + issue.title,
"description": "" + crashlyticsBaseUrl + issue.id + "\n",
"customFields": [
{
"id": config.crashlyticsIssueIdFieldId,
Expand Down Expand Up @@ -254,11 +254,11 @@ function notifySlack(config, issueBaseUrl, issues) {
var isFatal = "";
if (issue.isFatal)
isFatal = "Fatal Issue ";
return index + 1 + ". " + isFatal + issue.count + " Events. <" + issueBaseUrl + issue.id + "|" + issue.exceptionType + "(" + issue.exceptionMessage + ") " + issue.title + ">";
return index + 1 + ". " + isFatal + issue.count + " Events. " + issue.exceptionType + "(" + issue.exceptionMessage + ")<" + issueBaseUrl + issue.id + "|" + issue.title + ">";
})
.join('\n');
return [2 /*return*/, axiosClient.post(config.notifySlackUrl, {
text: "\u6628\u65E5\u8D77\u3053\u3063\u305F\u30AF\u30E9\u30C3\u30B7\u30E5\u30A4\u30D9\u30F3\u30C8(\u4E0A\u4F4D)\n " + text + "\n "
text: "\u6628\u65E5\u8D77\u3053\u3063\u305F\u30AF\u30E9\u30C3\u30B7\u30E5\u30A4\u30D9\u30F3\u30C8(\u4E0A\u4F4D)\n" + text
})];
});
});
Expand Down
12 changes: 4 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,8 @@ async function findWrikeTasks(config: WrikeConfig, issues: Array<CrashlyticsIssu

async function createWrikeTask(config: WrikeConfig, issue: CrashlyticsIssue, crashlyticsBaseUrl: string) {
return await axiosClient.post(`/folders/${config.folderId}/tasks`, {
"title": issue.title,
"description": `${crashlyticsBaseUrl}${issue.id}
`,
"title": `${issue.exceptionType}(${issue.exceptionMessage}) ${issue.title}`,
"description": `${crashlyticsBaseUrl}${issue.id}\n`,
"customFields": [
{
"id": config.crashlyticsIssueIdFieldId,
Expand Down Expand Up @@ -213,14 +211,12 @@ async function notifySlack(config: SlackNotifyConfig, issueBaseUrl: string, issu
const text = issues.map((issue, index) => {
var isFatal = ""
if (issue.isFatal) isFatal = "Fatal Issue "
return `${index + 1}. ${isFatal}${issue.count} Events. <${issueBaseUrl}${issue.id}|${issue.exceptionType}(${issue.exceptionMessage}) ${issue.title}>`
return `${index + 1}. ${isFatal}${issue.count} Events. ${issue.exceptionType}(${issue.exceptionMessage})<${issueBaseUrl}${issue.id}|${issue.title}>`
})
.join('\n');

return axiosClient.post(config.notifySlackUrl, {
text: `昨日起こったクラッシュイベント(上位)
${text}
`
text: `昨日起こったクラッシュイベント(上位)\n${text}`
});
}

Expand Down

0 comments on commit ed586fb

Please sign in to comment.