[pitivi] bin: Make it possible to run a command right after running pitivi-git



commit 0df01e5d224dbddec6d8eddfd3640bca3c51f620
Author: Thibault Saunier <thibault saunier collabora com>
Date:   Sat May 25 12:08:58 2013 -0400

    bin: Make it possible to run a command right after running pitivi-git

 bin/pitivi-git-environment.sh |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/bin/pitivi-git-environment.sh b/bin/pitivi-git-environment.sh
index 0c42265..4ca09d6 100755
--- a/bin/pitivi-git-environment.sh
+++ b/bin/pitivi-git-environment.sh
@@ -207,7 +207,10 @@ if test ! -d $PITIVI; then
 elif [ "$1" == "--build" ]; then
     # Only build modules without using autogen if not necessary, to save time
     force_autogen=0
-elif [ "$1" != "--force-autogen" ]; then
+    shift
+elif [ "$1" == "--force-autogen" ]; then
+    shift
+else
     # The folders existed, and the user just wants to set the shell environment
     ready_to_run=1
     force_autogen=0
@@ -410,6 +413,11 @@ if [ $ready_to_run == 1 ]; then
           # Display "PTV env:", path, " $ "
           changed_PS1='PS1="\[$(tput bold)$(tput setb 1)$(tput setaf 7)\]PTV env:\w\[$(tput sgr0)\] $ "'
       fi
-      bash --rcfile <(cat ~/.bashrc; echo $changed_PS1)
+      if [ -z "$*" ];
+      then
+        bash --rcfile <(cat ~/.bashrc; echo $changed_PS1)
+      else
+        /bin/bash -c "$*"
+      fi
     fi
 fi


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]