1
0
mirror of https://github.com/Foltik/dotfiles synced 2024-11-27 21:19:51 -05:00

Fix config location inference

This commit is contained in:
Jack Foltz 2018-12-09 01:19:55 -05:00
parent e6141d83ac
commit 024b6d63be
Signed by: foltik
GPG Key ID: D1F0331758D1F29A

View File

@ -52,6 +52,7 @@ class Package:
def transform_default(self, prop, default, basepath): def transform_default(self, prop, default, basepath):
default_path = local_path(basepath, default) default_path = local_path(basepath, default)
print(default_path)
if hasattr(self, prop): if hasattr(self, prop):
if isinstance(self[prop], list): if isinstance(self[prop], list):
self[prop] = list(map(lambda p: local_path(basepath, p), self[prop])) self[prop] = list(map(lambda p: local_path(basepath, p), self[prop]))
@ -59,13 +60,13 @@ class Package:
self[prop] = None self[prop] = None
elif self[prop] != None: elif self[prop] != None:
self[prop] = [local_path(basepath, self[prop])] self[prop] = [local_path(basepath, self[prop])]
elif (Path(basepath) / default_path).is_dir() or (Path(basepath) / default_path).is_file(): elif default_path.is_dir() or default_path.is_file():
self[prop] = [default_path] self[prop] = [default_path]
else: else:
self[prop] = None self[prop] = None
def update_from_files(self): def update_from_files(self):
self.transform_default('config', self.name, 'lain/') self.transform_default('config', self.name, 'lain/.config/')
self.transform_default('script', self.name + '.fish', 'scripts/') self.transform_default('script', self.name + '.fish', 'scripts/')
self.transform_default('userunit', self.name + '.service', 'lain/.config/systemd/user/') self.transform_default('userunit', self.name + '.service', 'lain/.config/systemd/user/')