[feat] Make regex eat trailing '/' in group 1
This commit is contained in:
2
dist/gcc_matcher.jsontemplate
vendored
2
dist/gcc_matcher.jsontemplate
vendored
@@ -4,7 +4,7 @@
|
|||||||
"owner": "gcc-problem-matcher",
|
"owner": "gcc-problem-matcher",
|
||||||
"pattern": [
|
"pattern": [
|
||||||
{
|
{
|
||||||
"regexp": "^(${{ BASE }})(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$",
|
"regexp": "^(${{ BASE }}\\/?)(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$",
|
||||||
"fromPath": 1,
|
"fromPath": 1,
|
||||||
"file": 2,
|
"file": 2,
|
||||||
"line": 3,
|
"line": 3,
|
||||||
|
|||||||
4
dist/index.js
vendored
4
dist/index.js
vendored
@@ -2848,7 +2848,7 @@ const core = __nccwpck_require__(127);
|
|||||||
// escapeRegExp :: string => string
|
// escapeRegExp :: string => string
|
||||||
// escape all characters with special meanings in regexp
|
// escape all characters with special meanings in regexp
|
||||||
const escapeRegExp = (s) =>
|
const escapeRegExp = (s) =>
|
||||||
s.replace(/[/\-^$*+?.()|[\]{}]/g, "\\$&");
|
s.replace(/[/\-^$*+?.()|[\]{}]/g, "\\\\$&");
|
||||||
|
|
||||||
// variable :: string => RegExp
|
// variable :: string => RegExp
|
||||||
// create regex to match ${{ key }}
|
// create regex to match ${{ key }}
|
||||||
@@ -2859,7 +2859,7 @@ const variable = (key) =>
|
|||||||
const templatePath = __nccwpck_require__.ab + "gcc_matcher.jsontemplate";
|
const templatePath = __nccwpck_require__.ab + "gcc_matcher.jsontemplate";
|
||||||
|
|
||||||
// matcherPath :: string
|
// matcherPath :: string
|
||||||
const matcherPath = __nccwpck_require__.ab + "gcc_matcher.json";
|
const outputPath = __nccwpck_require__.ab + "gcc_matcher.json";
|
||||||
|
|
||||||
// rootdir :: string
|
// rootdir :: string
|
||||||
const rootdir = core.getInput('build-directory', {required: false});
|
const rootdir = core.getInput('build-directory', {required: false});
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
"owner": "gcc-problem-matcher",
|
"owner": "gcc-problem-matcher",
|
||||||
"pattern": [
|
"pattern": [
|
||||||
{
|
{
|
||||||
"regexp": "^(${{ BASE }})(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$",
|
"regexp": "^(${{ BASE }}\\/?)(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$",
|
||||||
"fromPath": 1,
|
"fromPath": 1,
|
||||||
"file": 2,
|
"file": 2,
|
||||||
"line": 3,
|
"line": 3,
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ const core = require('@actions/core');
|
|||||||
// escapeRegExp :: string => string
|
// escapeRegExp :: string => string
|
||||||
// escape all characters with special meanings in regexp
|
// escape all characters with special meanings in regexp
|
||||||
const escapeRegExp = (s) =>
|
const escapeRegExp = (s) =>
|
||||||
s.replace(/[/\-^$*+?.()|[\]{}]/g, "\\$&");
|
s.replace(/[/\-^$*+?.()|[\]{}]/g, "\\\\$&");
|
||||||
|
|
||||||
// variable :: string => RegExp
|
// variable :: string => RegExp
|
||||||
// create regex to match ${{ key }}
|
// create regex to match ${{ key }}
|
||||||
@@ -16,7 +16,7 @@ const variable = (key) =>
|
|||||||
const templatePath = path.join(__dirname, "gcc_matcher.jsontemplate");
|
const templatePath = path.join(__dirname, "gcc_matcher.jsontemplate");
|
||||||
|
|
||||||
// matcherPath :: string
|
// matcherPath :: string
|
||||||
const matcherPath = path.join(__dirname, "gcc_matcher.json");
|
const outputPath = path.join(__dirname, "gcc_matcher.json");
|
||||||
|
|
||||||
// rootdir :: string
|
// rootdir :: string
|
||||||
const rootdir = core.getInput('build-directory', {required: false});
|
const rootdir = core.getInput('build-directory', {required: false});
|
||||||
@@ -34,7 +34,7 @@ const parse = (templatePath) => (matcherPath) => {
|
|||||||
|
|
||||||
// main:
|
// main:
|
||||||
try {
|
try {
|
||||||
parse(templatePath)(matcherPath);
|
parse(templatePath)(outputPath);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
core.setFailed(`Action failed with error ${err}`)
|
core.setFailed(`Action failed with error ${err}`)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user