X-Git-Url: https://git.armaanb.net/?p=lightcards.git;a=blobdiff_plain;f=setup.py;h=e7e3d138b6263ed1a6038cf581de7dbc8108408d;hp=939a7218a215c98921d608bc8cc4da21aed0b3fc;hb=HEAD;hpb=686515f147fb81974eb96246e9ceedf8b2d471ae diff --git a/setup.py b/setup.py index 939a721..e7e3d13 100644 --- a/setup.py +++ b/setup.py @@ -19,14 +19,17 @@ if os.geteuid() == 0: shutil.copyfile("./config.py", "/etc/lightcards/config.py") else: xdg = os.environ.get("XDG_CONFIG_HOME") + xdg_dest = f"{xdg}/lightcards/config.py" + home = os.path.expanduser("~") + home_dest = f"{home}/.config/lightcards/config.py" - if xdg: + if xdg and not os.path.exists(xdg_dest): mkdir(f"{xdg}/lightcards") - shutil.copyfile("./config.py", f"{xdg}/lightcards/config.py") - else: + shutil.copyfile("./config.py", xdg_dest) + elif not os.path.exists(home_dest): mkdir(f"{home}/.config/lightcards") - shutil.copyfile("./config.py", f"{home}/.config/lightcards/config.py") + shutil.copyfile("./config.py", home_dest) setup( @@ -35,7 +38,7 @@ setup( description="Terminal flashcards from Markdown", long_description=long_description, long_description_content_type="text/markdown", - url="https://sr.ht/~armaan/lightcards", + url="https://lightcards.armaanb.net", author="Armaan Bhojwani", author_email="me@armaanb.net", license="MIT",