Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(sync-files): add source-dir option #266

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sync-files/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. |
Expand Down
4 changes: 4 additions & 0 deletions sync-files/parse_config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import argparse
import os
import re
from pathlib import Path

Expand Down Expand Up @@ -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))


Expand Down