From 17b77fc7ccb0796c4c24f5bd2ab1bee4360c0614 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Tue, 16 May 2006 16:52:54 -0400 Subject: [PATCH] Make this work also when running from inside sugar/ --- sugar/sugar | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sugar/sugar b/sugar/sugar index 5d421183..b293f19b 100755 --- a/sugar/sugar +++ b/sugar/sugar @@ -3,8 +3,14 @@ import sys import os -basedir = os.path.dirname(os.path.dirname(__file__)) -if os.path.isfile(os.path.join(basedir, 'sugar', '__uninstalled__.py')): +curdir = os.path.dirname(__file__) + +if curdir == '.': + basedir = os.path.dirname(os.getcwd()) +else: + basedir = os.path.dirname(curdir) + +if os.path.isfile(os.path.join(curdir, '__uninstalled__.py')): if basedir == '': print "Running sugar from current directory..." else: