Commits

Thomas Pelletier committed 1062269

non-bash shell partial support

  • Participants
  • Parent commits 665a730

Comments (0)

Files changed (2)

 
 This will show the list of the commands.
 
+# For non-BASH shells
+
+I use a trick which only works on bash to guess the path of`virtual-manager`
+directory. If you are using another shell (such as ZSH), you have to set the
+`$VM_DIR` variable before sourcing the file:
+
+    export VM_DIR="/path/to/virtual-manager/"
+    source "$VM_DIR/vm.sh"
+
 ## Requirements
 
     * A Linux or Unix box.
 ## If you source it, it will create a custom `vm` function to wrap both the
 ## Python script and the `vmcd` hack
 
-# This is where the current script is.
-VM_DIR=$(dirname "${BASH_SOURCE[0]}")
+# If VM_DIR is not already set, try to guess the path of the current file.
+if [ "1${VM_DIR}" = "1" ]
+    then VM_DIR=$(dirname "${BASH_SOURCE[0]}")
+fi
 
 function _vmcd {
     VM_P=$(python "$VM_DIR/vm_cd.py" "$1")