voxpupuli / modulesync

Synchronize common files across your Git repositories.
Apache License 2.0
104 stars 48 forks source link

Allow to override the target path of a templated file #229

Open ccremer opened 3 years ago

ccremer commented 3 years ago

Files specified in config_defaults.yml and .sync.yml assume a static path that is the same for all managed modules.

however, there are cases where the content of a ERB template is managed in those modules, but the directory where this file is being saved is different for each module.

For example, the template may have a template/some_file.ext, but in the managed module it could be the module name, e.g. my-module/some_file.ext.

I could imagine a config like this: .sync.yml

template/some_file.ext:
  targetPath: my-module/some_file.ext

or in configs_defaults.yml:

template/some_file.ext:
  targetPath: <%= @metadata[:module_name] %>/some_file.ext