I'd like to be able to use multirust-rs on travis, but I can't because I need to answer "(Y/n)" to a question about if the install should proceed.
I can't even pipe the "yes" command into this because it reads directly from tty instead of stdin.
The next build will have a -y option that can be passed to both rustup-setup and rustup-setup.sh.
Sounds good! So I'll be able to do something like this:
install:
- curl -sf https://raw.githubusercontent.com/brson/multirust/master/blastoff.sh > ./multirust.sh
- chmod +x ./multirust.sh
- ./multirust.sh --yes
but using rustup instead of multirust?
curl https://sh.rustup.rs -sSf | sh -s -- -y
If you are SSH'd into a box, put nohup in front (for no hang-up).
To install Rustup unattended:
curl https://sh.rustup.rs -sSf | sh -s -- -y@theronic Can you please explain what
sh -s -- -ydoes here? I tried to Google it but the individual description ofsh -s,--and-ydoesn't seem to fit together to a coherent explanation.
sh -s Runs the stdin of sh as the script.
-s stdin Read commands from standard input (set automatically if no file arguments are present). This option has no effect when set after the shell has already started running (i.e. with set).
-- is used to tell the shell that further arguments are not options:
set [{ -options | +options | -- }] arg ...
The set command performs three different functions.
With no arguments, it lists the values of all shell variables.
If options are given, it sets the specified option flags, or clears them as described in the section called Argument List Processing. As a special case, if the option is -o or +o and no argument is supplied, the shell prints the settings of all its options. If the option
is -o, the settings are printed in a human-readable format; if the option is +o, the settings are printed in a format suitable for reinput to the shell to affect the same option settings.
The third use of the set command is to set the values of the shell's positional parameters to the specified args. To change the positional parameters without changing any options, use “--” as the first argument to set. If no args are present, the set command will clear
all the positional parameters (equivalent to executing “shift $#”.)
Thus the -y becomes passed to sh.rustup.rs as its first argument.
Ah, so sh.rustup.rs takes arguments as well! That explain it.
Thank you! :)
Most helpful comment
To install Rustup unattended:
If you are SSH'd into a box, put
nohupin front (for no hang-up).