Support calling of 'fdroid init' from other places

e.g. from a symlink to fdroid or from a script. Also more reliable in other
cases where argv[0] is not what we want.
This commit is contained in:
Daniel Martí 2014-06-30 19:38:38 +02:00
parent 348c6a1085
commit cef7cd2888

View file

@ -112,7 +112,7 @@ def main():
(options, args) = parser.parse_args() (options, args) = parser.parse_args()
# find root install prefix # find root install prefix
tmp = os.path.dirname(sys.argv[0]) tmp = os.path.normpath(os.path.join(os.path.dirname(__file__), '..'))
if os.path.basename(tmp) == 'bin': if os.path.basename(tmp) == 'bin':
prefix = os.path.dirname(tmp) prefix = os.path.dirname(tmp)
examplesdir = prefix + '/share/doc/fdroidserver/examples' examplesdir = prefix + '/share/doc/fdroidserver/examples'