Skip to content

Instantly share code, notes, and snippets.

@progrium
Created February 1, 2017 16:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save progrium/179ccc954018238034654cdd25cd36b9 to your computer and use it in GitHub Desktop.
Save progrium/179ccc954018238034654cdd25cd36b9 to your computer and use it in GitHub Desktop.
#!/bin/sh
## DO NOT RUN SCRIPT DIRECTLY
## Use `make deps-update`
set -e
ifupdated() {
local lastfile=".git/${2}"
if [ ! -f "$lastfile" ]; then
echo "no dep commit file for ${1}"
make $2
return
fi
local last="$(cat $lastfile)"
local current="$(git log -n 1 --pretty=format:%h -- ${1})"
if [ "$current" != "$last" ]; then
make $2
fi
}
ifupdated glide.yaml deps-go
ifupdated ui/package.json deps-js
ifupdated ui/semantic deps-css
# blah blah blah
deps-update: ## update dependencies if changed
./dev/deps.sh
deps-go:
glide install
git log -n 1 --pretty=format:%h -- glide.yaml > .git/deps-go
deps-js:
cd ui && npm install
git log -n 1 --pretty=format:%h -- ui/package.json > .git/deps-js
deps-css:
make -C ui/semantic
git log -n 1 --pretty=format:%h -- ui/semantic > .git/deps-css
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment