Skip to content

Commit

Permalink
feat(sync-files): add source-dir option (#266)
Browse files Browse the repository at this point in the history
* add source-dir

Signed-off-by: Takagi, Isamu <[email protected]>

* update readme

Signed-off-by: Takagi, Isamu <[email protected]>

---------

Signed-off-by: Takagi, Isamu <[email protected]>
  • Loading branch information
isamu-takagi authored Dec 15, 2023
1 parent 2a0be8e commit 5f405e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
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

0 comments on commit 5f405e0

Please sign in to comment.