Skip to content

Instantly share code, notes, and snippets.

@blech75
Created October 4, 2017 15:52
Show Gist options
  • Save blech75/f7841a393fed6a940d20c77335563f86 to your computer and use it in GitHub Desktop.
Save blech75/f7841a393fed6a940d20c77335563f86 to your computer and use it in GitHub Desktop.
diff `npm ls --depth=0` output versions between releases
#!/bin/bash
if [ "$#" -ne "1" ]; then
echo "Usage: `basename $0` RELEASES_DIR"
exit 1
fi
diff_releases() {
echo "Diffing $# releases..."
while [ $# -gt 1 ]; do
prev=$1
current=$2
diff -y --suppress-common-lines <(cd $prev && npm ls --depth=0) <(cd $current && npm ls --depth=0)
shift
done
}
diff_releases `ls $1 | sort`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment