fixes to use with symlonks
authorBen Doumenc <bdoumenc@gmail.com>
Sun, 5 May 2013 16:12:48 +0000 (18:12 +0200)
committerBen Doumenc <bdoumenc@gmail.com>
Sun, 5 May 2013 16:12:48 +0000 (18:12 +0200)
.gitignore [new file with mode: 0644]
android/prj_env
bash/bashrc
vim/vimrc

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..48e13e9
--- /dev/null
@@ -0,0 +1,2 @@
+
+vim/vimfiles/.netrwhist
index 1906cd5..2ab57a1 100644 (file)
@@ -1,5 +1,5 @@
 
-ANDROID_ROOT=$(dirname $(readlink -f $BASH_SOURCE))
+ANDROID_ROOT=$(dirname $BASH_SOURCE)
 
 export PATH=$PATH:$ANDROID_ROOT/android-sdk-linux/tools:$ANDROID_ROOT/android-sdk-linux/platform-tools
 export ANDROIDSDK=$ANDROID_ROOT/android-sdk-linux/
@@ -20,16 +20,23 @@ function loadApp() {
 
 function buildInstall() {
     pushd $APP_PATH > /dev/null 2>&1
-    ant debug && adb install -r bin/$APP_NAME-debug.apk
+    ant debug installd
+    popd 2>&1
+}
+
+function cleanBuild() {
+    pushd $APP_PATH > /dev/null 2>&1
+    ant clean debug 
     popd 2>&1
 }
 
 function cleanBuildInstall() {
     pushd $APP_PATH > /dev/null 2>&1
-    ant clean && buildInstall
+    ant clean debug install
     popd 2>&1
 }
 
+
 function logAll() {
     adb logcat
 }
index cfb803f..814f780 100644 (file)
@@ -2,8 +2,7 @@
 # Project manager
 
 OLD_PS1="$PS1"
-PERIPH_BASE_DIR=$HOME/work
-TVM_BASE_DIR=$HOME/sources
+WORK_BASE_DIR=${WORK_BASE_DIR:-$HOME/work}
 
 # FUNCTIONS
 function setGnomeTitle()
@@ -26,60 +25,38 @@ function cdBase() {
 
 # bash function that will allow you to set a project
 setProject() {
-       BASE_DIR=$1
-       GO_TO=$BASE_DIR/$2
+       GO_TO=$WORK_BASE_DIR/$1
        export PRJ_DIR=$GO_TO
        if [ -f $GO_TO/.prj_env ];then
                source $GO_TO/.prj_env
        fi
 
-       if [ -d $BASE_DIR/$2/trunk ]; then
-               GO_TO=$BASE_DIR/$2/trunk
+       if [ -d $WORK_BASE_DIR/$1/trunk ]; then
+               GO_TO=$WORK_BASE_DIR/$1/trunk
         export PRJ_DIR=$GO_TO
                if [ -f $GO_TO/.prj_env ];then
                        source $GO_TO/.prj_env
                fi
        fi
        cd $GO_TO
-       export PS1="[$2] $OLD_PS1"
+       export PS1="[$1] $OLD_PS1"
        setGnomeTitle $@
 
 }
 
 # Define autocompletion functions 
-_setPeriphProject ()
+_setProject ()
 {
         local cur
         _get_comp_words_by_ref cur
         COMPREPLY=()
-        if ls ${PERIPH_BASE_DIR}/${cur}* >/dev/null 2>&1;then
-                COMPREPLY=( $(ls -1d ${PERIPH_BASE_DIR}/${cur}*|sed "s#${PERIPH_BASE_DIR}/##") )
+        if ls ${WORK_BASE_DIR}/${cur}* >/dev/null 2>&1;then
+                COMPREPLY=( $(ls -1d ${WORK_BASE_DIR}/${cur}*|sed "s#${WORK_BASE_DIR}/##") )
         fi
         return 0
 } 
 
-_setTvmProject ()
-{
-        local cur
-        _get_comp_words_by_ref cur
-        COMPREPLY=()
-        if ls ${TVM_BASE_DIR}/${cur}* >/dev/null 2>&1;then
-                COMPREPLY=( $(ls -1d ${TVM_BASE_DIR}/${cur}*|sed "s#${TVM_BASE_DIR}/##") )
-        fi
-        return 0
-} 
-
-
-function setPeriphProject() {
-       setProject $PERIPH_BASE_DIR $1
-}
-
-function setTvmProject() {
-       setProject $TVM_BASE_DIR $1
-}
-
-complete -F _setPeriphProject setPeriphProject
-complete -F _setTvmProject setTvmProject
+complete -F _setProject setProject
 
 # Python startup file
 export PYTHONSTARTUP=$HOME/.pythonrc
@@ -228,9 +205,6 @@ cvsWrap() {
     esac
 }
 
-alias connectTransfolio='rdesktop -u "afc-admin" -p "*admin25*" -m -T "RENFE TRSF" -g 1200x1000 172.16.101.10'
-alias connectDAT1='rdesktop -u "CEVIMA1" -p "CEVIMA1" -m -T "RENFE DAT FULL" -g 1280x1024 172.16.111.3'
-
 function toUtf8() {
        for file in "$@"; do
         iconv --verbose --from-code=latin1 --to-code=utf8 -o $file $file
index 26972de..7630b35 100644 (file)
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -53,7 +53,7 @@ if filereadable("/etc/vim/vimrc.local")
   source /etc/vim/vimrc.local
 endif
 
-if filereadable("/home/bdoumenc/.customVimrc")
-  source /home/bdoumenc/.customVimrc
+if filereadable(eval("$HOME") . "/.customVimrc")
+  source $HOME/.customVimrc
 endif