mirror of
https://github.com/apple/pkl.git
synced 2026-05-25 16:19:20 +02:00
Only write changed files
This commit is contained in:
@@ -32,8 +32,8 @@ class CliFormatterApply(cliBaseOptions: CliBaseOptions, path: Path, private val
|
|||||||
val contents = Files.readString(path)
|
val contents = Files.readString(path)
|
||||||
val (formatted, stat) = format(path, contents)
|
val (formatted, stat) = format(path, contents)
|
||||||
status = if (status == 0) stat else status
|
status = if (status == 0) stat else status
|
||||||
if (stat != 0) continue
|
if (stat != 0 || contents == formatted) continue
|
||||||
if (!silent && contents != formatted) {
|
if (!silent) {
|
||||||
consoleWriter.write(path.toAbsolutePath().toString())
|
consoleWriter.write(path.toAbsolutePath().toString())
|
||||||
consoleWriter.appendLine()
|
consoleWriter.appendLine()
|
||||||
consoleWriter.flush()
|
consoleWriter.flush()
|
||||||
|
|||||||
Reference in New Issue
Block a user