Skip to content

Commit 6fecfc8

Browse files
committed
Update logging in writeFiles function to handle newline characters more accurately
1 parent 6bb8f92 commit 6fecfc8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

internal/utils_fs.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,11 @@ func writeFiles(paths []string, contents []string, logger *logger.Logger) error
129129
logger.UpdateLastSecondaryPrefix("setup")
130130

131131
if strings.HasSuffix(content, "\n") {
132-
logger.Infof("echo %q > %q", content[:len(content)-1], paths[i])
132+
if strings.Count(content, "\n") > 1 {
133+
logger.Infof("echo -e %q > %q", content, paths[i])
134+
} else {
135+
logger.Infof("echo %q > %q", content[:len(content)-1], paths[i])
136+
}
133137
} else {
134138
logger.Infof("echo -n %q > %q", content, paths[i])
135139
}

0 commit comments

Comments
 (0)