From e774d43ca46eecea9ac9dfc5f12c5180acdc3dc6 Mon Sep 17 00:00:00 2001 From: Heikki Hokkanen Date: Sun, 13 Dec 2009 13:29:02 +0200 Subject: [PATCH] Also look for resource files in ../share/gitstats. This allows installing in other locations besides /usr. --- gitstats | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gitstats b/gitstats index 7bb9128..1c0fc80 100755 --- a/gitstats +++ b/gitstats @@ -481,8 +481,10 @@ class HTMLReportCreator(ReportCreator): ReportCreator.create(self, data, path) self.title = data.projectname - # copy static files if they do not exist - basedirs = [os.path.dirname(os.path.abspath(__file__)), '/usr/share/gitstats'] + # copy static files. Looks in the binary directory, ../share/gitstats and /usr/share/gitstats + binarypath = os.path.dirname(os.path.abspath(__file__)) + secondarypath = os.path.join(binarypath, '..', 'share', 'gitstats') + basedirs = [binarypath, secondarypath, '/usr/share/gitstats'] for file in ('gitstats.css', 'sortable.js', 'arrow-up.gif', 'arrow-down.gif', 'arrow-none.gif'): for base in basedirs: src = base + '/' + file -- 2.11.4.GIT