You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in https://github.com/rust-lang-nursery/rustup.rs/blob/master/rustup-init.sh uses ANSI color codes. Before outputting the line, we ought to check if stdout is connected to a terminal, eg using test / [, so that users running without a terminal don't get rubbish in their logs if redirecting. Additionally, to be truly robust, we ought to then output the ANSI sequences using tput. However, tput isn't common on embedded systems built around Busybox and the like, so one needs to be quite defensive.
A strategy I've used in the past is lines here 70 through to 250. Obviously that's extensive, but it works. In addition, we seem to check for the presence of printf (need_cmd printf). That seems a little odd, as all POSIX compliant shells that I know of support it. I can't vouch for zsh or ksh93.
As an extra special super-pedantic nit, the printf output should be going to stderr as it's progress information. I'll get my coat...
The text was updated successfully, but these errors were encountered:
This is a minor nit. This line:-
in
https://github.com/rust-lang-nursery/rustup.rs/blob/master/rustup-init.sh
uses ANSI color codes. Before outputting the line, we ought to check if stdout is connected to a terminal, eg usingtest
/[
, so that users running without a terminal don't get rubbish in their logs if redirecting. Additionally, to be truly robust, we ought to then output the ANSI sequences usingtput
. However,tput
isn't common on embedded systems built around Busybox and the like, so one needs to be quite defensive.A strategy I've used in the past is lines here 70 through to 250. Obviously that's extensive, but it works. In addition, we seem to check for the presence of
printf
(need_cmd printf
). That seems a little odd, as all POSIX compliant shells that I know of support it. I can't vouch forzsh
orksh93
.As an extra special super-pedantic nit, the
printf
output should be going tostderr
as it's progress information. I'll get my coat...The text was updated successfully, but these errors were encountered: