Created
February 1, 2017 16:50
-
-
Save progrium/179ccc954018238034654cdd25cd36b9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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