diff options
author | Vincent Ambo <tazjin@gmail.com> | 2017-06-11T21·11+0200 |
---|---|---|
committer | Vincent Ambo <tazjin@gmail.com> | 2017-06-11T21·16+0200 |
commit | cf5e392baffb6db275c02a757e5ec92afff741c7 (patch) | |
tree | c9f3b1c751d8ff27d15c36120316ce28b1d590d1 /diff-deps.fish | |
parent | a7781b169df929028f2d4e4fe2f6b297aede60e5 (diff) |
feat: Add shell script to check if dependencies are up-to-date
Diffstat (limited to 'diff-deps.fish')
-rwxr-xr-x | diff-deps.fish | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/diff-deps.fish b/diff-deps.fish new file mode 100755 index 000000000000..4a5bf7585cdd --- /dev/null +++ b/diff-deps.fish @@ -0,0 +1,29 @@ +#!/usr/bin/env fish + +function get_remote_master + git ls-remote "$argv[1]" | \ + grep 'refs/heads/master' | \ + awk '{print $1}' +end + +function list_deps + grep '"git"' -B2 kontemplate.frm | \ + grep -P -o '(?<=silo: ")https://.+(?=")' +end + +function diff_dep + set -l current (grep -B1 "$argv[1]" kontemplate.frm | grep -P -o '(?<=hash: ").+(?=")') + set -l remote (get_remote_master "$argv[1]") + + if [ $current != $remote ] + echo "$argv[1]" + echo -e "current:\t$current" + echo -e "remote:\t\t$remote\n" + else + echo -e "$argv[1] up to date\n" + end +end + +for dep in (list_deps) + diff_dep $dep +end |