Skip to content

Instantly share code, notes, and snippets.

@jdforsythe
Created March 23, 2016 14:47
Show Gist options
  • Save jdforsythe/3297fc91bb2a29ce4b77 to your computer and use it in GitHub Desktop.
Save jdforsythe/3297fc91bb2a29ce4b77 to your computer and use it in GitHub Desktop.
Find all VS projects that reference a Nuget Package as a dependency from a top-level dev folder
#!/bin/bash
DEFAULT_VS_PROJECT_TOP_LEVEL_FOLDER="/e/dev/internal-apps"
echo "Finding all projects using NuGet package for ${1}"
# find all nested folders with a packages.config file (where the NuGet package references are stored)
# loop through the results
find ${2:-"${DEFAULT_VS_PROJECT_TOP_LEVEL_FOLDER}"} -name "packages.config" -exec grep -l "${1}" {} \; | while read -r filename ; do
echo $(basename "$(dirname "$filename")")
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment