diff options
author | Jon Ringle <jon@ringle.org> | 2010-03-08 18:16:59 -0500 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2010-03-09 00:32:32 +0100 |
commit | 3c5cec0f85fc1eb23a037f051902e0c699551da7 (patch) | |
tree | 2438d12fe198ef9fa5e810bca605ec50ffe1b52c /bin | |
parent | 07f75bc8f3f654887ae3f27fb714be92b6543c5d (diff) | |
download | ptxdist-3c5cec0f85fc1eb23a037f051902e0c699551da7.tar.gz ptxdist-3c5cec0f85fc1eb23a037f051902e0c699551da7.tar.xz |
[ptxdist bash] Integrate prefixing "[ptx] " to PS1 in "ptxdist bash"
Invoke 'ptxdist bash' will give you a ptxdist environment with your
PS1 prompt prefixed with "[ptx] ", so that you are aware of the
environment your current shell is in.
Signed-off-by: Jon Ringle <jon@ringle.org>
[mkl: use ${BASH}, simplified exit]
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/ptxdist | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/bin/ptxdist b/bin/ptxdist index 2eebf6e5e..af602ae8c 100755 --- a/bin/ptxdist +++ b/bin/ptxdist @@ -802,6 +802,8 @@ Misc: use 'newpackage help' for a longer description print <var> print the contents of a variable, in the way it is known by "make" + bash enter a ptxdist environment bash shell + bash <cmd> [args...] execute <cmd> in ptxdist environment export_src <target dir> export all source archives needed for this project to <target dir> Overwrite defaults: @@ -1783,7 +1785,17 @@ parse_second() bash) check_premake_compiler && - "${@}" + if [ ${#} -eq 0 ]; then + local bashrc="${PTXDIST_TEMPDIR}/bashrc" + cat > "${bashrc}" <<EOF +. /etc/bash.bashrc +. ~/.bashrc +PS1="[ptx] \${PS1}" +EOF + "${BASH}" --init-file "${bashrc}" + else + "${@}" + fi exit ;; clean) |