Skip to content

Commit 65d32d5

Browse files
committed
Refine logging in writeFiles function to differentiate between single and multiple newline characters
1 parent 93cfff6 commit 65d32d5

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
@@ -135,7 +135,11 @@ func writeFiles(paths []string, contents []string, logger *logger.Logger) error
135135
logger.Infof("echo -e %q > %q", content[:len(content)-1], paths[i])
136136
}
137137
} else {
138-
logger.Infof("echo -n %q > %q", content, paths[i])
138+
if strings.Contains(content, "\n") {
139+
logger.Infof("echo -ne %q > %q", content, paths[i])
140+
} else {
141+
logger.Infof("echo -n %q > %q", content, paths[i])
142+
}
139143
}
140144

141145
logger.ResetSecondaryPrefixes()

0 commit comments

Comments
 (0)