[feat] Add fromPath to matcher template
This commit is contained in:
13
dist/gcc_matcher.jsontemplate
vendored
13
dist/gcc_matcher.jsontemplate
vendored
@@ -4,12 +4,13 @@
|
||||
"owner": "gcc-problem-matcher",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "^.*?${{ BASE }}\/?(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"column": 3,
|
||||
"severity": 4,
|
||||
"message": 5
|
||||
"regexp": "^(${{ BASE }})(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$",
|
||||
"fromPath": 1,
|
||||
"file": 2,
|
||||
"line": 3,
|
||||
"column": 4,
|
||||
"severity": 5,
|
||||
"message": 6
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
11
dist/index.js
vendored
11
dist/index.js
vendored
@@ -2862,18 +2862,13 @@ const templatePath = __nccwpck_require__.ab + "gcc_matcher.jsontemplate";
|
||||
const matcherPath = __nccwpck_require__.ab + "gcc_matcher.json";
|
||||
|
||||
// rootdir :: string
|
||||
const rootdir = () =>
|
||||
core.getInput('build-directory', {required: false});
|
||||
const rootdir = core.getInput('build-directory', {required: false});
|
||||
|
||||
// parse :: IO() => IO() => Error | null
|
||||
// parse :: string => string => Error | null
|
||||
const parse = (templatePath) => (matcherPath) => {
|
||||
const r = rootdir();
|
||||
|
||||
console.log(r);
|
||||
|
||||
const content = fs.readFileSync(templatePath, 'utf-8');
|
||||
|
||||
const parsed = content.replace(variable("BASE"), escapeRegExp(rootdir()));
|
||||
const parsed = content.replace(variable("BASE"), escapeRegExp(rootdir));
|
||||
|
||||
fs.writeFileSync(matcherPath, parsed);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user