aboutsummaryrefslogtreecommitdiff
path: root/.github/scripts/install_deps.sh
diff options
context:
space:
mode:
authordundargoc <33953936+dundargoc@users.noreply.github.com>2023-04-29 15:43:54 +0200
committerGitHub <noreply@github.com>2023-04-29 15:43:54 +0200
commit933fdff4660a17b1df7809105c57825e0ece1fc6 (patch)
tree6e084d77fa7349179ff058a0559421f66b076c5b /.github/scripts/install_deps.sh
parent13a24b905e1646767fed908b8dbdb535a65414ab (diff)
downloadrneovim-933fdff4660a17b1df7809105c57825e0ece1fc6.tar.gz
rneovim-933fdff4660a17b1df7809105c57825e0ece1fc6.tar.bz2
rneovim-933fdff4660a17b1df7809105c57825e0ece1fc6.zip
ci: make install_deps.sh more flexible
This will allow us to use it in containers as well as specify whether we want to install test dependencies.
Diffstat (limited to '.github/scripts/install_deps.sh')
-rwxr-xr-x.github/scripts/install_deps.sh27
1 files changed, 24 insertions, 3 deletions
diff --git a/.github/scripts/install_deps.sh b/.github/scripts/install_deps.sh
index 29f4d73a7f..bb99873267 100755
--- a/.github/scripts/install_deps.sh
+++ b/.github/scripts/install_deps.sh
@@ -1,10 +1,31 @@
#!/bin/bash
+SUDO="sudo"
+
+while (($# > 0)); do
+ case $1 in
+ --test) # install test dependencies
+ TEST=1
+ shift
+ ;;
+ --container) # don't use sudo
+ SUDO=""
+ shift
+ ;;
+ esac
+done
+
os=$(uname -s)
if [[ $os == Linux ]]; then
- sudo apt-get update
- sudo apt-get install -y build-essential cmake curl gettext locales-all ninja-build pkg-config unzip "$@"
+ $SUDO apt-get update
+ $SUDO apt-get install -y build-essential cmake curl gettext ninja-build pkg-config unzip
+ if [[ -n $TEST ]]; then
+ $SUDO apt-get install -y locales-all cpanminus
+ fi
elif [[ $os == Darwin ]]; then
brew update --quiet
- brew install ninja "$@"
+ brew install ninja
+ if [[ -n $TEST ]]; then
+ brew install cpanminus
+ fi
fi