[pitivi] bin: Do not change directory if sourced or launching a command



commit d37504ec6e0ed012c9e76cdf6106cd26c7a48d19
Author: Thibault Saunier <thibault saunier collabora com>
Date:   Mon May 27 21:27:38 2013 -0400

    bin: Do not change directory if sourced or launching a command
    
    +Rework the way we set PS1

 bin/pitivi-git-environment.sh |   14 ++++----------
 1 files changed, 4 insertions(+), 10 deletions(-)
---
diff --git a/bin/pitivi-git-environment.sh b/bin/pitivi-git-environment.sh
index 66173a3..682de1f 100755
--- a/bin/pitivi-git-environment.sh
+++ b/bin/pitivi-git-environment.sh
@@ -389,7 +389,6 @@ fi
 
 
 if [ $ready_to_run == 1 ]; then
-    cd $PITIVI/pitivi
     # Change the looks of the prompt, to help us remember we're in a subshell.
     # If the user has some custom git bash helpers, try preserving them.
 
@@ -405,17 +404,12 @@ if [ $ready_to_run == 1 ]; then
       echo "pitivi-git environment is being sourced"
       export PS1="[ptv] $PS1"
     else
-      if function_exists __git_ps1
-      then
-          # Display "PTV env:", path, the output of __git_ps1, " $ "
-          changed_PS1='PS1="\[$(tput bold)$(tput setb 1)$(tput setaf 7)\]PTV env:\w\[$(tput 
sgr0)\]\$(__git_ps1)$ "'
-      else
-          # Display "PTV env:", path, " $ "
-          changed_PS1='PS1="\[$(tput bold)$(tput setb 1)$(tput setaf 7)\]PTV env:\w\[$(tput sgr0)\] $ "'
-      fi
       if [ -z "$*" ];
       then
-        bash --rcfile <(cat ~/.bashrc; echo $changed_PS1)
+        cd $PITIVI/pitivi
+        cp ~/.bashrc /tmp/ptvCustomPS1
+        echo "export PS1=[ptv]\ \$PS1" >> /tmp/ptvCustomPS1
+        bash --rcfile /tmp/ptvCustomPS1
       else
         /bin/bash -c "$*"
       fi


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