Skip to content

Instantly share code, notes, and snippets.

@MrTarantula
Created November 6, 2017 22:24
Show Gist options
  • Save MrTarantula/9422afa1fcaa75a76886cefedd84bb18 to your computer and use it in GitHub Desktop.
Save MrTarantula/9422afa1fcaa75a76886cefedd84bb18 to your computer and use it in GitHub Desktop.
Duplicate files in .*proj files
var proj = ``;
const pattern = /\s*<Content Include="(.*)" \/>/;
const testing = proj.split("\n");
const matches = [];
testing.forEach((str) => {
if (str.match(pattern)) {
if (matches.find((match) => match === str)) {
console.log("Duplicate found: " + str);
}
matches.push(str);
}
});
console.log(matches.length === 0 ? "No matches found" : "Finished searching");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment