Rust's simple download script

Vladimir Panteleev via Digitalmars-d digitalmars-d at puremagic.com
Mon Nov 9 15:19:16 PST 2015


On Monday, 9 November 2015 at 23:13:03 UTC, H. S. Teoh wrote:
> On Mon, Nov 09, 2015 at 06:07:57PM -0500, Andrei Alexandrescu 
> via Digitalmars-d wrote:
>> Rust has a nice way to download at 
>> https://www.rust-lang.org/downloads.html for Posix:
>> 
>> $ curl -sSf https://static.rust-lang.org/rustup.sh | sh -s --
>> 
>> The method is simple and transparent. An optional 
>> --channel=beta or --channel=nightly parameter chooses between 
>> a stable release (default), beta, or nightly build.
>> 
>> Should we do something similar?
> [...]
>
> Probably...
>
> ... though I have to admit that the idea of running a shell 
> script downloaded from some random remote server (and that, as 
> root, as otherwise it probably wouldn't work) scares me. A lot.

Yeah, piping curl into shell is often criticized. It is 
convenient, though, so could be provided as an option if enough 
people show interest.

It doesn't have to be run as root, as it can just download and 
unpack a portable installation (essentially what we have in the 
zip files).

If we do this, it has to be done right (e.g. IIRC putting all 
code in a function so an interrupted download doesn't run a 
partial script).



More information about the Digitalmars-d mailing list