gnucash-on-windows master: Make devrc.sh less picky about where it's called from

Geert Janssens gjanssens at code.gnucash.org
Tue Apr 18 17:39:28 EDT 2017


Updated	 via  https://github.com/Gnucash/gnucash-on-windows/commit/9974359d (commit)
	from  https://github.com/Gnucash/gnucash-on-windows/commit/27491ec2 (commit)



commit 9974359d0450da9058aa41ca142f5b7d5fa5e667
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Tue Apr 18 23:39:20 2017 +0200

    Make devrc.sh less picky about where it's called from
    
    You can now source it from anywhere as long as
    - devrc.sh is still in gnucash-on-windows.git
    - gnucash-on-windows.git is where the bootstrap script originally created it
    
    devrc.sh makes some assumptions about other directory locations. If you overrode any
    of these in custom.sh, this will currently not be picked up and hence devrc.sh
    will not set up the environment properly for direct development.

diff --git a/devrc.sh b/devrc.sh
index 1cb5c91..70c20e6 100644
--- a/devrc.sh
+++ b/devrc.sh
@@ -26,10 +26,15 @@
 
 export OLDPATH=$PATH
 
-_currdir=`pwd`
-_dirname=`basename $_currdir`
+
+_savedir="$(pwd)"
+cd "$(dirname ${BASH_SOURCE[0]})"
+_currdir="$(pwd)"
+cd "$_savedir"
+
+_dirname="$(basename $_currdir)"
 if [ $(expr $_dirname : gnucash-on-windows.*) -ne 0 ]; then
-    GLOBAL_UDIR=`dirname $_currdir`
+    GLOBAL_UDIR="$(dirname $_currdir)"
 else
     echo "Source me in gnucash-on-windows so that I can set the right directory."
     return



Summary of changes:
 devrc.sh | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)



More information about the gnucash-changes mailing list