diff --git a/bin/git-cola b/bin/git-cola index 1947dfe..e20dade 100755 --- a/bin/git-cola +++ b/bin/git-cola @@ -26,6 +26,8 @@ def cola_init(): # Try to detect where it is run from and set prefix and the search path. # It is assumed that the user installed Cola using the --prefix= option prefix = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + if os.path.islink(__file__): + prefix = os.path.dirname(os.path.dirname(os.readlink(__file__))) # Look for modules in the source or install trees thirdparty = os.path.join(prefix, 'thirdparty') @@ -36,6 +38,7 @@ def cola_init(): else: # Install tree: prefer cola paths_to_try = [os.path.join(prefix, 'share', 'git-cola', 'lib')] + paths_to_try = paths_to_try + [os.path.join(prefix, 'lib', '@PYTHON@', 'site-packages')] sys.path = paths_to_try + sys.path if __name__ == '__main__': diff --git a/bin/git-dag b/bin/git-dag index e689d6b..fc4115b 100755 --- a/bin/git-dag +++ b/bin/git-dag @@ -26,6 +26,8 @@ def cola_init(): # Try to detect where it is run from and set prefix and the search path. # It is assumed that the user installed Cola using the --prefix= option prefix = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + if os.path.islink(__file__): + prefix = os.path.dirname(os.path.dirname(os.readlink(__file__))) # Look for modules in the source or install trees thirdparty = os.path.join(prefix, 'thirdparty') @@ -36,6 +38,7 @@ def cola_init(): else: # Install tree: prefer cola paths_to_try = [os.path.join(prefix, 'share', 'git-cola', 'lib')] + paths_to_try = paths_to_try + [os.path.join(prefix, 'lib', '@PYTHON@', 'site-packages')] sys.path = paths_to_try + sys.path