Skip to content

Commit

Permalink
Add upstream status script
Browse files Browse the repository at this point in the history
  • Loading branch information
jackpot51 committed Oct 12, 2017
1 parent 348dd4a commit 569bc08
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ function usage {
echo " stage" >&2
echo " unstage" >&2
echo " status" >&2
echo " status_upstream" >&2
echo " tar" >&2
echo " untar" >&2
echo " update" >&2
Expand Down Expand Up @@ -121,6 +122,17 @@ function op {
git -C source diff --name-status
fi
;;
status_upstream)
if [ -n "$GIT_UPSTREAM" ]
then
if [ -n "$BRANCH" ]
then
git -C source diff --name-status "upstream/$BRANCH"
else
git -C source diff --name-status "upstream/master"
fi
fi
;;
update)
pushd source > /dev/null
skip=0
Expand Down
24 changes: 24 additions & 0 deletions status_upstream.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash
set -e

source config.sh

if [ $# = 0 ]
then
recipes="$(ls -1 recipes)"
else
recipes="$@"
fi

for recipe in $recipes
do
if [ -d "recipes/$recipe/source" ]
then
status="$(COOK_QUIET=1 ./cook.sh "$recipe" status_upstream)"

if [ -n "$status" ]
then
echo -e "\e[1m$recipe\e[0m\n$status"
fi
fi
done

0 comments on commit 569bc08

Please sign in to comment.