actions-rust-cross/dev/bin/install-dev-tools.sh
aaronvg 42fe96a4c1
Add support for a "working-directory" parameter
This commit updates the tests to check that this works and also rewrites the
test script from Bash to Perl.

Co-authored-by: Dave Rolsky <autarch@urth.org>
2023-09-10 15:12:49 -05:00

47 lines
949 B
Bash
Executable File

#!/bin/bash
set -eo pipefail
function run () {
echo $1
eval $1
}
function install_tools () {
curl --silent --location \
https://raw.githubusercontent.com/houseabsolute/ubi/master/bootstrap/bootstrap-ubi.sh |
sh
run "ubi --project houseabsolute/precious --in ~/bin"
run "ubi --project houseabsolute/omegasort --in ~/bin"
run "npm install prettier"
run "curl -L https://cpanmin.us/ -o ~/bin/cpanm"
run "chmod 0755 ~/bin/cpanm"
run "~/bin/cpanm --sudo --notest Perl::Tidy"
}
if [ "$1" == "-v" ]; then
set -x
fi
mkdir -p $HOME/bin
set +e
echo ":$PATH:" | grep --extended-regexp ":$HOME/bin:" >& /dev/null
if [ "$?" -eq "0" ]; then
path_has_home_bin=1
fi
set -e
if [ -z "$path_has_home_bin" ]; then
PATH=$HOME/bin:$PATH
fi
install_tools
echo "Tools were installed into $HOME/bin."
if [ -z "$path_has_home_bin" ]; then
echo "You should add $HOME/bin to your PATH."
fi
exit 0