Skip to content

Commit

Permalink
fix: expand globs (#42)
Browse files Browse the repository at this point in the history
expand raw copy globs when removing files from templated file list
  • Loading branch information
rogueserenity authored Jul 23, 2024
1 parent a071c3f commit bf66c0f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion features/steps/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def step_impl(
with open(os.path.join(leaf_dir1, "file.txt"), "w", encoding="utf-8") as f:
f.write("Rogue")
with open(os.path.join(leaf_dir2, "file.txt"), "w", encoding="utf-8") as f:
f.write("Serenity")
f.write("{{Serenity}}")

yaml_data = {
"templates": [
Expand Down
1 change: 0 additions & 1 deletion features/update/local.feature
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ Feature: Local Template Processing
When I run stenciler update in the current directory
Then I see the current directory updated with the template data

@wip
Scenario: Init only files are not copied during an update
Given I have a local updated template with init-only files
When I run stenciler update in the current directory
Expand Down
8 changes: 7 additions & 1 deletion files/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ func CopyTemplated(repoDir string, tmplate *config.Template) error {
if err != nil {
return fmt.Errorf("failed to generate file list: %w", err)
}
fileList = removeFromFileList(fileList, tmplate.RawCopyPaths)

rawList, err := createFileList(srcRootPath, tmplate.RawCopyPaths)
if err != nil {
return fmt.Errorf("failed to generate raw copy file list: %w", err)
}

fileList = removeFromFileList(fileList, rawList)

if tmplate.Update {
initOnlyList, err := createFileList(srcRootPath, tmplate.InitOnlyPaths)
Expand Down

0 comments on commit bf66c0f

Please sign in to comment.