Skip to content

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" }}