This repository was archived by the owner on Apr 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change 5
5
if [ "$toolchain" = "" ]; then
6
6
toolchain=stable
7
7
fi
8
- curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $toolchain
9
- echo "##vso[task.prependpath]$HOME/.cargo/bin"
8
+ if command -v rustup; then
9
+ rustup update $toolchain
10
+ rustup default $toolchain
11
+ else
12
+ curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $toolchain
13
+ echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin"
14
+ fi
10
15
displayName: Install rust (unix)
11
16
condition: ne( variables['Agent.OS'], 'Windows_NT' )
12
17
13
- - script : |
14
- curl -sSf -o rustup-init.exe https://win.rustup.rs
15
- rustup-init.exe -y --default-toolchain stable-%TARGET%
16
- echo ##vso[task.prependpath]%USERPROFILE%\.cargo\bin
18
+ - bash : rustup update stable-$TOOLCHAIN && rustup default stable-$TOOLCHAIN
17
19
displayName : Install rust (windows)
18
20
condition : eq( variables['Agent.OS'], 'Windows_NT' )
19
21
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ run() {
18
18
--user $( id -u) :$( id -g) \
19
19
-e CARGO_HOME=/cargo \
20
20
-e CARGO_TARGET_DIR=/target \
21
- -v $HOME /. cargo:/cargo \
21
+ -v $( dirname $( dirname ` which cargo` ) ) :/cargo \
22
22
-v ` pwd` /target:/target \
23
23
-v ` pwd` :/checkout:ro \
24
24
-v ` rustc --print sysroot` :/rust:ro \
You can’t perform that action at this time.
0 commit comments