From abd11823c2369eef72782cf60370ff81f8b1b31b Mon Sep 17 00:00:00 2001
From: jD91mZM2 <me@krake.one>
Date: Thu, 19 Apr 2018 08:52:36 +0200
Subject: [PATCH] Fix termplay recipe (sorry)

---
 cook.sh                    | 12 ++++++++++++
 recipes/termplay/recipe.sh |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/cook.sh b/cook.sh
index 15a1ea106..17dd9821e 100755
--- a/cook.sh
+++ b/cook.sh
@@ -358,8 +358,18 @@ function op {
                 fi
 
                 bins="$(find target/$TARGET/$build/ -maxdepth 1 -type f ! -name '*.*')"
+                if [ -z "$bins" ]
+                then
+                    example=true
+                    bins="$(find target/$TARGET/$build/examples/ -maxdepth 1 -type f ! -name '*.*' ! -name '*-*' \
+                            2> /dev/null || true)"
+                fi
                 if [ -n "$bins" ]
                 then
+                    if [ -n "$example" ]
+                    then
+                        echo "$(tput bold)Note$(tput sgr0): No binaries detected, using example binaries" >&2
+                    fi
                     mkdir -p "../stage/$BINDIR"
                     for bin in $bins
                     do
@@ -370,6 +380,8 @@ function op {
                             strip -v "$bin" -o "../stage/$BINDIR/$(basename $bin)"
                         fi
                     done
+                else
+                    echo "$(tput bold)Warning$(tput sgr0): Recipe does not have any binaries" >&2
                 fi
 
                 docgen ../source ../stage/ref
diff --git a/recipes/termplay/recipe.sh b/recipes/termplay/recipe.sh
index c48fb7900..3bb91958b 100644
--- a/recipes/termplay/recipe.sh
+++ b/recipes/termplay/recipe.sh
@@ -1,2 +1,2 @@
 GIT=https://github.com/jD91mZM2/termplay.git
-CARGOFLAGS="--no-default-features --features termion"
+CARGOFLAGS="--no-default-features --features termion --example termplay"
-- 
GitLab