Prevent wrapping of post installation script in swiftly init#500
Prevent wrapping of post installation script in swiftly init#500cmcgee1024 merged 3 commits intoswiftlang:mainfrom
Conversation
Sources/MacOSPlatform/MacOS.swift
Outdated
| """) | ||
| """ | ||
|
|
||
| if ctx.format == .text { |
There was a problem hiding this comment.
should we just call ctx.message here? Isn't the conditional for the format handled there
There was a problem hiding this comment.
It's a good point. Maybe ctx.message should internally make the switch between stdout/stderr instead of requiring clients to do that.
Sources/Swiftly/Init.swift
Outdated
| // This is a plain print instead of a ctx.message to avoid line wrapping of the | ||
| // post install script. When it is wrapped then it is harder to copy and paste | ||
| // the contents from the terminal. | ||
| print("\(Messages.postInstall(postInstall))") |
There was a problem hiding this comment.
would it make more sense to just pretend a newline to this message and still rely on ctx.message? Just thinking about if a user is using json output
There was a problem hiding this comment.
I'll try another pass on this by abstracting JSON output/text (stderr/stdout), and provide a flag that allows the client to indicate whether auto-word wrapping should be disabled for a particular string.
etcwilde
left a comment
There was a problem hiding this comment.
This is probably fine for now, though I wonder if we do want it to wrap, but escape the newlines correctly? e.g
% apt-get install -y \
blah \
blah \
blahI think that is more legible than the wall of text. Thoughts?
|
I generally like the idea of escaping the newlines of commands so that each argument can be considered. In this case it's probably not as important to most users each individual package as it is that there are packages that need to be installed by the system package manager, so it's probably not as important to devote a line to each package. |
No description provided.