@@ -9,23 +9,29 @@ if [ "${CI:-}" == "true" ]; then
99else
1010 _BIN_DIR=$HOME /.local/bin
1111fi
12- if [ ! -f $_BIN_DIR /just ]; then
13- if [ " Windows_NT" = " ${OS:- } " ]; then
14- _TARGET=" --target x86_64-pc-windows-msvc"
15- else
16- _TARGET=" "
17- fi
12+
13+
14+ function _pip_install() {
15+ _HERE=$( dirname ${BASH_SOURCE:- $0 } )
16+ . $_HERE /utils.sh
17+ _VENV_PATH=$( mktemp -d)
18+ echo " Installing $2 using pip..."
19+ createvirtualenv " $( find_python3) " $_VENV_PATH
20+ python -m pip install $1
21+ ln -s " $( which $2 ) " $_BIN_DIR /$2
22+ echo " Installing $2 using pip... done."
23+ }
24+
25+
26+ # Ensure just is installed.
27+ if ! command -v just 2> /dev/null; then
28+ # On most systems we can install directly.
29+ echo " Installing just..."
1830 curl --proto ' =https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- $_TARGET --to " $_BIN_DIR " || {
19- # CARGO_HOME is defined in configure-env.sh
20- export CARGO_HOME=${CARGO_HOME:- $HOME / .cargo/ }
21- export RUSTUP_HOME=" ${CARGO_HOME} /.rustup"
22- . ${DRIVERS_TOOLS} /.evergreen/install-rust.sh
23- cargo install just
24- if [ " Windows_NT" = " ${OS:- } " ]; then
25- mv $CARGO_HOME /just.exe $_BIN_DIR /just
26- else
27- mv $CARGO_HOME /just $_BIN_DIR
28- fi
29- export PATH=" $_BIN_DIR :$PATH "
31+ _pip_install rust-just just
3032 }
33+ if ! command -v just 2> /dev/null; then
34+ export PATH=" $PATH :$_BIN_DIR "
35+ fi
36+ echo " Installing just... done."
3137fi
0 commit comments