From f0fc137b6bbc053da40087e624a73e4be2eb372b Mon Sep 17 00:00:00 2001 From: Brian Surowiec Date: Mon, 17 Feb 2020 21:07:00 -0500 Subject: [PATCH] Release v1.1.0 --- dist/index.js | 67 ++++++++++++++++++++++++++++----------- dist/problem-matcher.json | 16 ++++++++++ 2 files changed, 65 insertions(+), 18 deletions(-) create mode 100644 dist/problem-matcher.json diff --git a/dist/index.js b/dist/index.js index 4da6d17..1a1a50e 100644 --- a/dist/index.js +++ b/dist/index.js @@ -55,30 +55,47 @@ module.exports = require("os"); "use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; Object.defineProperty(exports, "__esModule", { value: true }); +const fs_1 = __webpack_require__(747); const path_1 = __webpack_require__(622); +const util_1 = __webpack_require__(669); const core_1 = __webpack_require__(470); const command_1 = __webpack_require__(431); +const readFileAsync = util_1.promisify(fs_1.readFile); function run() { - try { - const action = core_1.getInput("action"); - switch (action) { - case "add": - command_1.issueCommand("add-matcher", {}, __webpack_require__.ab + "dotnet-format-problem-matcher.json"); - break; - case "remove": - command_1.issueCommand("remove-matcher", { - owner: "dotnet-format", - }, ""); - break; - default: - throw Error(`Unsupported action "${action}"`); + return __awaiter(this, void 0, void 0, function* () { + try { + const action = core_1.getInput("action"); + const matcherFile = __webpack_require__.ab + "problem-matcher.json"; + switch (action) { + case "add": + command_1.issueCommand("add-matcher", {}, __webpack_require__.ab + "problem-matcher.json"); + break; + case "remove": + const fileContents = yield readFileAsync(__webpack_require__.ab + "problem-matcher.json", { encoding: "utf8" }); + const problemMatcher = JSON.parse(fileContents); + command_1.issueCommand("remove-matcher", { + owner: problemMatcher.owner, + }, ""); + break; + default: + throw Error(`Unsupported action "${action}"`); + } } - } - catch (error) { - core_1.setFailed(error.message); - throw error; - } + catch (error) { + core_1.setFailed(error.message); + throw error; + } + }); } exports.run = run; run(); @@ -385,6 +402,20 @@ exports.getState = getState; module.exports = require("path"); +/***/ }), + +/***/ 669: +/***/ (function(module) { + +module.exports = require("util"); + +/***/ }), + +/***/ 747: +/***/ (function(module) { + +module.exports = require("fs"); + /***/ }) /******/ }); \ No newline at end of file diff --git a/dist/problem-matcher.json b/dist/problem-matcher.json new file mode 100644 index 0000000..83875a3 --- /dev/null +++ b/dist/problem-matcher.json @@ -0,0 +1,16 @@ +{ + "problemMatcher": [ + { + "owner": "dotnet-format", + "pattern": [ + { + "regexp": "^\\s+(.*)\\((\\d+),(\\d+)\\):\\s+(.*)$", + "file": 1, + "line": 2, + "column": 3, + "message": 4 + } + ] + } + ] +}