Skip to content

Instantly share code, notes, and snippets.

@gistlyn
Last active September 30, 2019 07:51
Show Gist options
  • Save gistlyn/8b409d00eff942279d3532975fa66965 to your computer and use it in GitHub Desktop.
Save gistlyn/8b409d00eff942279d3532975fa66965 to your computer and use it in GitHub Desktop.
Script to update ServiceStack's modified interned version of Fluent Validation
vfsFileSystem('.') |> to => source
vfsFileSystem('../../ServiceStack/src/ServiceStack/') |> to => target
#function transform (src)
return (src.replace('namespace FluentValidation', 'namespace ServiceStack.FluentValidation'))
/function
`\nWriting files in: FluentValidation.ValidatorAttribute/ ...`
#each file in dirFiles('FluentValidation.ValidatorAttribute').where(f => f.Name.endsWith('.cs'))
file.textContents() |> transform |> to => updated
`FluentValidation/ValidatorAttribute/${file.Name}` |> to => toPath
target.writeFile(toPath, updated)
/each
#each dir in source.dirDirectories('FluentValidation').where(d => !(['bin','obj'].contains(d.Name)))
`\nWriting files in: ${dir.VirtualPath}...`
#each file in source.dirFiles(dir.VirtualPath).where(f => f.Name.endsWith('.cs'))
file.textContents() |> transform |> to => updated
target.writeFile(file.VirtualPath, updated)
/each
/each
#each file in dirFiles('FluentValidation/Resources/Languages').where(f => f.Name.endsWith('.cs'))
file.textContents() |> transform |> to => updated
target.writeFile(file.VirtualPath, updated)
/each
`\nWriting files in: FluentValidation/ ...`
#each file in source.dirFiles('FluentValidation').where(f => f.Name.endsWith('.cs'))
file.textContents() |> transform |> to => updated
target.writeFile(file.VirtualPath, updated)
/each
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment