Skip to content

Commit

Permalink
Release v1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
xt0rted committed Feb 18, 2020
1 parent ebdbfbb commit 1eea26b
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 16 deletions.
67 changes: 51 additions & 16 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,27 +55,48 @@ 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":
console.log(`::add-matcher::${path_1.join(__dirname, "..", ".github", "stylelint-problem-matcher.json")}`);
break;
case "remove":
console.log("::remove-matcher owner=stylelint::");
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 problemMatcherDocument = JSON.parse(fileContents);
const problemMatcher = problemMatcherDocument.problemMatcher[0];
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 @@ -382,6 +403,20 @@ exports.getState = getState;

module.exports = require("path");

/***/ }),

/***/ 669:
/***/ (function(module) {

module.exports = require("util");

/***/ }),

/***/ 747:
/***/ (function(module) {

module.exports = require("fs");

/***/ })

/******/ });
21 changes: 21 additions & 0 deletions dist/problem-matcher.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"problemMatcher": [
{
"owner": "stylelint",
"pattern": [
{
"regexp": "^([^\\s].*)$",
"file": 1
},
{
"regexp": "^\\s+((\\d+):(\\d+))?\\s+(✖|×)\\s+(.*)\\s{3,}(.*)$",
"line": 2,
"column": 3,
"message": 5,
"code": 6,
"loop": true
}
]
}
]
}

0 comments on commit 1eea26b

Please sign in to comment.