mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-06 14:52:57 +00:00
adding ability to use variables from the config file in templates
This commit is contained in:
@@ -38,6 +38,9 @@ class Cfg:
|
||||
# transformations keys
|
||||
key_trans = 'trans'
|
||||
|
||||
# template variables
|
||||
key_variables = 'variables'
|
||||
|
||||
# dotfiles keys
|
||||
key_dotfiles = 'dotfiles'
|
||||
key_dotfiles_src = 'src'
|
||||
@@ -479,6 +482,11 @@ class Cfg:
|
||||
"""return all defined settings"""
|
||||
return self.lnk_settings.copy()
|
||||
|
||||
def get_variables(self):
|
||||
if self.key_variables in self.content:
|
||||
return self.content[self.key_variables]
|
||||
return {}
|
||||
|
||||
def dump(self):
|
||||
"""return a dump of the config"""
|
||||
# temporary reset dotpath
|
||||
|
||||
Reference in New Issue
Block a user