-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Adding file.MigrateTo, a system for migrating old files to new …
…templates (#235) Do you want to move a file around in your target repositories, which already has customizations in blocks that you don't want to lose? MigrateTo now moves this file for you, letting the new template pick it up. The next pass of the template rendering will then pick up the migrated file in the new location under the new template and render any updates with the new template, as if the user had moved the file themselves. <!-- !!!! README !!!! Please fill this out. Please follow conventional commit naming conventions: https://www.conventionalcommits.org/en/v1.0.0/#summary --> <!-- A short description of what your PR does and what it solves. --> ## What this PR does / why we need it <!-- Notes that may be helpful for anyone reviewing this PR --> ## Notes for your reviewers
- Loading branch information
Showing
24 changed files
with
198 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
order: 1004 | ||
--- | ||
|
||
<!-- Generated by tools/docgen. DO NOT EDIT. --> | ||
|
||
# file.MigrateTo | ||
|
||
MigrateTo migrates the current file to a new path. If the old file | ||
doesn't exist, it is treated as a `file.Skip`. If the old file still | ||
exists, then it is moved to the new path (via a create and write, then | ||
delete of the old path, not a filesystem move). If the MigrateTo target | ||
file already exists, it is overwritten. | ||
|
||
```go | ||
{{- file.MigrateTo "new/path/to/file.txt" }} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
order: 1004 | ||
order: 1005 | ||
--- | ||
|
||
<!-- Generated by tools/docgen. DO NOT EDIT. --> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
order: 1005 | ||
order: 1006 | ||
--- | ||
|
||
<!-- Generated by tools/docgen. DO NOT EDIT. --> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
order: 1006 | ||
order: 1007 | ||
--- | ||
|
||
<!-- Generated by tools/docgen. DO NOT EDIT. --> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
order: 1007 | ||
order: 1008 | ||
--- | ||
|
||
<!-- Generated by tools/docgen. DO NOT EDIT. --> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
order: 1008 | ||
order: 1009 | ||
--- | ||
|
||
<!-- Generated by tools/docgen. DO NOT EDIT. --> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
order: 1009 | ||
order: 1010 | ||
--- | ||
|
||
<!-- Generated by tools/docgen. DO NOT EDIT. --> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
order: 1010 | ||
order: 1011 | ||
--- | ||
|
||
<!-- Generated by tools/docgen. DO NOT EDIT. --> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
order: 1011 | ||
order: 1012 | ||
--- | ||
|
||
<!-- Generated by tools/docgen. DO NOT EDIT. --> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
order: 1012 | ||
order: 1013 | ||
--- | ||
|
||
<!-- Generated by tools/docgen. DO NOT EDIT. --> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
order: 1013 | ||
order: 1014 | ||
--- | ||
|
||
<!-- Generated by tools/docgen. DO NOT EDIT. --> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
order: 1014 | ||
order: 1015 | ||
--- | ||
|
||
<!-- Generated by tools/docgen. DO NOT EDIT. --> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
order: 1015 | ||
order: 1016 | ||
--- | ||
|
||
<!-- Generated by tools/docgen. DO NOT EDIT. --> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
order: 1016 | ||
order: 1017 | ||
--- | ||
|
||
<!-- Generated by tools/docgen. DO NOT EDIT. --> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
order: 1017 | ||
order: 1018 | ||
--- | ||
|
||
<!-- Generated by tools/docgen. DO NOT EDIT. --> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
order: 1018 | ||
order: 1019 | ||
--- | ||
|
||
<!-- Generated by tools/docgen. DO NOT EDIT. --> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
order: 1019 | ||
order: 1020 | ||
--- | ||
|
||
<!-- Generated by tools/docgen. DO NOT EDIT. --> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
order: 1020 | ||
order: 1021 | ||
--- | ||
|
||
<!-- Generated by tools/docgen. DO NOT EDIT. --> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
order: 1021 | ||
order: 1022 | ||
--- | ||
|
||
<!-- Generated by tools/docgen. DO NOT EDIT. --> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
order: 1022 | ||
order: 1023 | ||
--- | ||
|
||
<!-- Generated by tools/docgen. DO NOT EDIT. --> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
order: 1023 | ||
order: 1024 | ||
--- | ||
|
||
<!-- Generated by tools/docgen. DO NOT EDIT. --> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
order: 1024 | ||
order: 1025 | ||
--- | ||
|
||
<!-- Generated by tools/docgen. DO NOT EDIT. --> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters