fix addTextToFile & tests

This commit is contained in:
ansgarz 2025-02-27 21:32:22 +01:00
parent c1e3bfbd41
commit 284d2e4a36

View file

@ -240,7 +240,7 @@ fun Prov.addTextToFile(
return@taskWithResult ProvResult(true, out = "Text already in file") return@taskWithResult ProvResult(true, out = "Text already in file")
} }
cmd( cmd(
"printf '%s' " + "${text + "\n"}" "printf '%s' " + text
.escapeAndEncloseByDoubleQuoteForShell() + " | ${sudoAsText(sudo)} tee -a ${file.path} > /dev/null" .escapeAndEncloseByDoubleQuoteForShell() + " | ${sudoAsText(sudo)} tee -a ${file.path} > /dev/null"
) )
} }