summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2020-06-25 11:03:51 (EDT)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2020-06-25 11:03:51 (EDT)
commitcfd8ed745a420c8b842610b33f2e2edf8a06e93c (patch)
tree3fbeeb1fa50b22ca12877912883f93fed8380cbf
parent4daa379927d395c51086fd2b71a51427b4cd1f20 (diff)
cmd/shell: Return exit status
-rw-r--r--NEWS1
-rw-r--r--src/cmd/shell.sh8
2 files changed, 6 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index 8299e5e..a6d3cc0 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,7 @@ Changes in this release:
* "prokit build" now passes an "-a" option, if supported, to opkg to
install host-architecture non-coinstallable dependencies (such as
library development packages) when cross building.
+ * "prokit shell" now returns the shell's exit status.
ProteanOS Development Kit version 2.0.1
---------------------------------------
diff --git a/src/cmd/shell.sh b/src/cmd/shell.sh
index 0c5a7b0..2cc53ad 100644
--- a/src/cmd/shell.sh
+++ b/src/cmd/shell.sh
@@ -22,6 +22,7 @@ cmd_shell_main()
{
local root=
local dev=
+ local es=
if [ ${#} -lt 1 ]; then
print_cmd_usage 'shell' >&2
@@ -48,18 +49,19 @@ cmd_shell_main()
[ "x${dev}" != 'x' ] && block_umount "${root}"
return 2
fi
+ es=0
if [ ${#} -eq 0 ]; then
- session_exec /bin/sh
+ session_exec /bin/sh || es=${?}
printf '\n'
info "$(get_msg 'cmd_shell_exiting')"
else
- session_exec "${@}"
+ session_exec "${@}" || es=${?}
fi
session_end
[ "x${dev}" != 'x' ] && block_umount "${root}"
- return 0
+ return ${es}
}
cmd_shell_register()