[Toaster] [PATCH 4/4] toaster: exit or return depending on the mode
Ed Bartosh
ed.bartosh at linux.intel.com
Wed Oct 14 05:33:23 PDT 2015
When toaster script is sourced 'return' should be used as
using 'exit' will cause script to exit the shell and close terminal
window. If script is called 'exit' should be used. Otherwise shell
will throw and error:
return: can only `return' from a function or sourced script
Used 'return' or 'exit' depending on the toaster mode using
TOASTER_MANAGED variable.
Signed-off-by: Ed Bartosh <ed.bartosh at linux.intel.com>
---
bitbake/bin/toaster | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bitbake/bin/toaster b/bitbake/bin/toaster
index 2f6fed9..2571714 100755
--- a/bitbake/bin/toaster
+++ b/bitbake/bin/toaster
@@ -180,7 +180,7 @@ if [ "$TOASTER_CONF" = "" ]; then
fi
if [ ! -f $TOASTER_CONF ]; then
echo "$TOASTER_CONF configuration file not found. set TOASTER_CONF to specify a path"
- exit 1;
+ [ "$TOASTER_MANAGED" = '1' ] && exit 1 || return 1
fi
# this defines the dir toaster will use for
# 1) clones of layers (in _toaster_clones )
--
2.1.4
More information about the toaster
mailing list