diff --git a/ankisyncctl.py b/ankisyncctl.py index 0ac9cd8..2d19d34 100755 --- a/ankisyncctl.py +++ b/ankisyncctl.py @@ -1,4 +1,4 @@ -#! /usr/bin/env python2 +#!/usr/bin/env python import os import sys @@ -29,6 +29,13 @@ def startsrv(configpath): if not configpath: configpath = SERVERCONFIG + # We change to the directory containing the config file + # so that all the paths will be relative to it. + configdir = os.path.dirname(configpath) + if configdir != '': + os.chdir(configdir) + configpath = os.path.basename(configpath) + devnull = open(os.devnull, "w") pid = subprocess.Popen( "ankisyncd",