Skip to content

Commit f0fc137

Browse files
committed
Release v1.1.0
1 parent c686932 commit f0fc137

File tree

2 files changed

+65
-18
lines changed

2 files changed

+65
-18
lines changed

dist/index.js

Lines changed: 49 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -55,30 +55,47 @@ module.exports = require("os");
5555

5656
"use strict";
5757

58+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
59+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
60+
return new (P || (P = Promise))(function (resolve, reject) {
61+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
62+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
63+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
64+
step((generator = generator.apply(thisArg, _arguments || [])).next());
65+
});
66+
};
5867
Object.defineProperty(exports, "__esModule", { value: true });
68+
const fs_1 = __webpack_require__(747);
5969
const path_1 = __webpack_require__(622);
70+
const util_1 = __webpack_require__(669);
6071
const core_1 = __webpack_require__(470);
6172
const command_1 = __webpack_require__(431);
73+
const readFileAsync = util_1.promisify(fs_1.readFile);
6274
function run() {
63-
try {
64-
const action = core_1.getInput("action");
65-
switch (action) {
66-
case "add":
67-
command_1.issueCommand("add-matcher", {}, __webpack_require__.ab + "dotnet-format-problem-matcher.json");
68-
break;
69-
case "remove":
70-
command_1.issueCommand("remove-matcher", {
71-
owner: "dotnet-format",
72-
}, "");
73-
break;
74-
default:
75-
throw Error(`Unsupported action "${action}"`);
75+
return __awaiter(this, void 0, void 0, function* () {
76+
try {
77+
const action = core_1.getInput("action");
78+
const matcherFile = __webpack_require__.ab + "problem-matcher.json";
79+
switch (action) {
80+
case "add":
81+
command_1.issueCommand("add-matcher", {}, __webpack_require__.ab + "problem-matcher.json");
82+
break;
83+
case "remove":
84+
const fileContents = yield readFileAsync(__webpack_require__.ab + "problem-matcher.json", { encoding: "utf8" });
85+
const problemMatcher = JSON.parse(fileContents);
86+
command_1.issueCommand("remove-matcher", {
87+
owner: problemMatcher.owner,
88+
}, "");
89+
break;
90+
default:
91+
throw Error(`Unsupported action "${action}"`);
92+
}
7693
}
77-
}
78-
catch (error) {
79-
core_1.setFailed(error.message);
80-
throw error;
81-
}
94+
catch (error) {
95+
core_1.setFailed(error.message);
96+
throw error;
97+
}
98+
});
8299
}
83100
exports.run = run;
84101
run();
@@ -385,6 +402,20 @@ exports.getState = getState;
385402

386403
module.exports = require("path");
387404

405+
/***/ }),
406+
407+
/***/ 669:
408+
/***/ (function(module) {
409+
410+
module.exports = require("util");
411+
412+
/***/ }),
413+
414+
/***/ 747:
415+
/***/ (function(module) {
416+
417+
module.exports = require("fs");
418+
388419
/***/ })
389420

390421
/******/ });

dist/problem-matcher.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"owner": "dotnet-format",
5+
"pattern": [
6+
{
7+
"regexp": "^\\s+(.*)\\((\\d+),(\\d+)\\):\\s+(.*)$",
8+
"file": 1,
9+
"line": 2,
10+
"column": 3,
11+
"message": 4
12+
}
13+
]
14+
}
15+
]
16+
}

0 commit comments

Comments
 (0)