Module Make_corrected_fileSource
Source
val f :
?use_dot_patdiff:Base.bool ->
?corrected_path:Base.string ->
?use_color:Base.bool ->
?diff_command:Base.string ->
?diff_path_prefix:Base.string ->
next_contents:Base.string ->
path:Base.string ->
Base.unit ->
Base.unit Base.Or_error.tf ~next_contents ~path () compares the contents of path against next_contents. If the contents are unchanged, f returns Ok (). If they are changed, it writes next_contents to corrected_path, emits a build error, and returns Error _. The caller should exit nonzero (possibly by raising the returned error) to indicate to the build that an error occurred. If it doesn't, the build system may not recognize that a corrected file has been generated and needs to be moved out of a sandbox.
The optional arguments support "expert" use cases. Most clients do not need them.
If path does not exist, its contents are assumed to be "". This is a convenience for creating new files on the first run of a correction.