Skip to content

Commit

Permalink
Fixes #20: support csproj elements with a single ItemGroup
Browse files Browse the repository at this point in the history
  • Loading branch information
amlweems committed Dec 4, 2020
1 parent 2853b3f commit fe1c296
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1118,13 +1118,18 @@ const parseCsProjData = async function (csProjData) {
if (!csProjData) {
return pkgList;
}
const project = convert.xml2js(csProjData, {
const projects = convert.xml2js(csProjData, {
compact: true,
alwaysArray: true,
spaces: 4,
textKey: "_",
attributesKey: "$",
commentKey: "value",
}).Project;
if (projects.length == 0) {
return pkgList;
}
const project = projects[0];
if (project.ItemGroup && project.ItemGroup.length) {
for (let i in project.ItemGroup) {
const item = project.ItemGroup[i];
Expand Down

0 comments on commit fe1c296

Please sign in to comment.