Skip to content

Commit

Permalink
feat: allow folder of problem matcher registration
Browse files Browse the repository at this point in the history
Allows registering of new problem matchers by adding them to folder
  • Loading branch information
nschonni committed Aug 15, 2020
1 parent 59e61b8 commit f450ba5
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 15 deletions.
11 changes: 7 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4632,6 +4632,7 @@ const installer = __importStar(__webpack_require__(749));
const auth = __importStar(__webpack_require__(202));
const path = __importStar(__webpack_require__(622));
const url_1 = __webpack_require__(835);
const fs = __importStar(__webpack_require__(747));
function run() {
return __awaiter(this, void 0, void 0, function* () {
try {
Expand All @@ -4655,10 +4656,12 @@ function run() {
if (registryUrl) {
auth.configAuthentication(registryUrl, alwaysAuth);
}
const matchersPath = path.join(__dirname, '..', '.github');
console.log(`##[add-matcher]${path.join(matchersPath, 'tsc.json')}`);
console.log(`##[add-matcher]${path.join(matchersPath, 'eslint-stylish.json')}`);
console.log(`##[add-matcher]${path.join(matchersPath, 'eslint-compact.json')}`);
// Iterate and register all problem matchers
const matchersPath = path.join(__dirname, '..', 'matchers');
const matchers = fs.readdirSync(matchersPath);
matchers.forEach((matcher) => {
console.log(`##[add-matcher]${path.join(matchersPath, matcher)}`);
});
}
catch (error) {
core.setFailed(error.message);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
21 changes: 10 additions & 11 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as installer from './installer';
import * as auth from './authutil';
import * as path from 'path';
import {URL} from 'url';
import * as fs from 'fs';

export async function run() {
try {
Expand Down Expand Up @@ -30,18 +31,16 @@ export async function run() {
auth.configAuthentication(registryUrl, alwaysAuth);
}

const matchersPath = path.join(__dirname, '..', '.github');
console.log(`##[add-matcher]${path.join(matchersPath, 'tsc.json')}`);
console.log(
`##[add-matcher]${path.join(matchersPath, 'eslint-stylish.json')}`
);
console.log(
`##[add-matcher]${path.join(matchersPath, 'eslint-compact.json')}`
);
} catch (error) {
core.setFailed(error.message);
// Iterate and register all problem matchers
const matchersPath = path.join(__dirname, '..', 'matchers');
const matchers = fs.readdirSync(matchersPath);
matchers.forEach((matcher) => {
console.log(`##[add-matcher]${path.join(matchersPath, matcher)}`);
})
} catch (error) {
core.setFailed(error.message);
}
}
}

function isGhes(): boolean {
const ghUrl = new URL(
Expand Down

0 comments on commit f450ba5

Please sign in to comment.