diff --git a/sync-files/README.md b/sync-files/README.md index 832d448a..cbcd9c23 100644 --- a/sync-files/README.md +++ b/sync-files/README.md @@ -57,6 +57,7 @@ The specifications are: | --------------------- | -------- | -------------------------------------------- | ---------------------------------------------------------------------------------------- | | repository | true | - | The target repository. | | ref | false | The default branch of the target repository. | The version of the target repository. | +| source-dir | false | Not prefixed. | The prefix common to `files/source`. This does not apply to the default of `files/dest`. | | files/source | true | - | The path to the file in the target repository. | | files/dest | false | The same as `files/source`. | The path where to place the synced file in the base repository. | | files/replace | false | `true` | Whether to replace the synced file if it already exists. | diff --git a/sync-files/parse_config.py b/sync-files/parse_config.py index a0a7cd0c..cb65ab3f 100644 --- a/sync-files/parse_config.py +++ b/sync-files/parse_config.py @@ -1,4 +1,5 @@ import argparse +import os import re from pathlib import Path @@ -42,6 +43,9 @@ def main(): if "post-commands" not in item: item["post-commands"] = "" + if "source-dir" in repo_config: + item["source"] = os.path.join(repo_config["source-dir"], item["source"]) + print(yaml.dump(config))