Skip to content

Commit

Permalink
Merge pull request #21 from amlweems/csproj-one-itemgroup
Browse files Browse the repository at this point in the history
Fixes #20: support csproj elements with a single ItemGroup
  • Loading branch information
prabhu authored Dec 4, 2020
2 parents 2853b3f + fe1c296 commit 7dedadc
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 7dedadc

Please sign in to comment.