1. Thomas Pelletier
  2. virtual-manager


Thomas Pelletier  committed 1062269

non-bash shell partial support

  • Participants
  • Parent commits 665a730
  • Branches default

Comments (0)

Files changed (2)

File README.md

View file
 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.

File vm.sh

View file
 ## 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]}")
 function _vmcd {
     VM_P=$(python "$VM_DIR/vm_cd.py" "$1")