Skip to content

Commit

Permalink
Release v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
xt0rted committed Feb 18, 2020
1 parent c686932 commit f0fc137
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 18 deletions.
67 changes: 49 additions & 18 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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");

/***/ })

/******/ });
16 changes: 16 additions & 0 deletions dist/problem-matcher.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"problemMatcher": [
{
"owner": "dotnet-format",
"pattern": [
{
"regexp": "^\\s+(.*)\\((\\d+),(\\d+)\\):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"message": 4
}
]
}
]
}

0 comments on commit f0fc137

Please sign in to comment.