Skip to content

Instantly share code, notes, and snippets.

@apaleslimghost
Created July 1, 2014 10:31
Show Gist options
  • Save apaleslimghost/a9d2d3616bffeb4d738a to your computer and use it in GitHub Desktop.
Save apaleslimghost/a9d2d3616bffeb4d738a to your computer and use it in GitHub Desktop.
Find out which modules have no dependents
readonly files="path/to/scripts/entry.js"
readonly base="path/to/scripts"
readonly opts="-t whatever"
list_deps() {
local entries=$1
local opts=$2
browserify $opts --list $entries \
| sed "s:$(pwd)::" \
| grep $base \
| sort \
| uniq
}
list_files() {
find $base -type f \
| sort
}
main() {
diff =(list_deps "$files" "$opts") =(list_files)
}
main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment