Skip to content

Instantly share code, notes, and snippets.

@gistlyn gistlyn/sync-fv.sc.hbs
Last active Sep 30, 2019

Embed
What would you like to do?
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
You can’t perform that action at this time.