Skip to content

Instantly share code, notes, and snippets.

@jeffwhelpley
Last active August 29, 2015 14:04
Show Gist options
  • Save jeffwhelpley/be850c3c05224e747212 to your computer and use it in GitHub Desktop.
Save jeffwhelpley/be850c3c05224e747212 to your computer and use it in GitHub Desktop.
Avoiding peerDependencies issue
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"

check_run() {
	echo "$changed_files" | grep --quiet "$1" && eval "$2"
}

# if package.json is in the list of git changes, then refresh node_modules
check_run package.json "rm -rf node_modules"
check_run package.json "npm install"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment