Skip to content
Snippets Groups Projects
Unverified Commit 893f7caa authored by Kamil Kowalski's avatar Kamil Kowalski Committed by GitHub
Browse files

fix(manager/mix): comment handling in dependency extraction (#19142)

parent 7c04604b
No related branches found
No related tags found
No related merge requests found
......@@ -15,8 +15,7 @@ defmodule MyProject.MixProject do
end
defp deps() do
[
#{:broadway_dashboard, "~> 0.2.2"},
[ #{:broadway_dashboard, "~> 0.2.2"},
#{:broadway_dashboard, "~> 0.2.2"},
# {:broadway_dashboard, "~> 0.2.2"},
# {:broadway_dashboard, "~> 0.2.2"},
......
......@@ -8,7 +8,7 @@ const depSectionRegExp = regEx(/defp\s+deps.*do/g);
const depMatchRegExp = regEx(
/{:(?<depName>\w+),\s*(?<datasource>[^:"]+)?:?\s*"(?<currentValue>[^"]+)",?\s*(?:organization: "(?<organization>.*)")?.*}/gm
);
const commentMatchRegExp = regEx(/^\s*#/);
const commentMatchRegExp = regEx(/#.*$/);
export async function extractPackageFile(
content: string,
......@@ -18,7 +18,7 @@ export async function extractPackageFile(
const deps: PackageDependency[] = [];
const contentArr = content
.split(newlineRegex)
.filter((line) => !commentMatchRegExp.test(line));
.map((line) => line.replace(commentMatchRegExp, ''));
for (let lineNumber = 0; lineNumber < contentArr.length; lineNumber += 1) {
if (contentArr[lineNumber].match(depSectionRegExp)) {
let depBuffer = '';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment