Install shfmt on Ubuntu 22.04, otherwise skip running linter (#1323)

This commit is contained in:
Gulshan Singh 2022-10-22 16:33:00 -07:00 committed by GitHub
parent aaf9ad2151
commit 7efaa33b0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 5 deletions

View File

@ -22,7 +22,6 @@ jobs:
run: |
./setup.sh --user
./setup-dev.sh --user
sudo snap install shfmt
- name: Run linters
run: |

View File

@ -49,8 +49,12 @@ fi
flake8 --show-source ${LINT_FILES}
# Indents are four spaces, binary ops can start a line, and indent switch cases
shfmt -i 4 -bn -ci -d .
if [ -x "$(command -v shfmt)" ]; then
# Indents are four spaces, binary ops can start a line, and indent switch cases
shfmt -i 4 -bn -ci -d .
else
echo "shfmt not installed, skipping"
fi
# Checking minimum python version
vermin -q -t=3.6 --violations ./pwndbg/

View File

@ -34,6 +34,11 @@ install_apt() {
curl \
build-essential \
gdb
if [[ "$1" == "22.04" ]]; then
sudo apt install shfmt
fi
test -f /usr/bin/go || sudo apt-ge\t install -y golang
# Install zig to current directory
@ -57,11 +62,18 @@ install_apt() {
}
if linux; then
distro=$(grep "^ID=" /etc/os-release | cut -d'=' -f2 | sed -e 's/"//g')
distro=$(
. /etc/os-release
echo ${ID}
)
case $distro in
"ubuntu")
install_apt
ubuntu_version=$(
. /etc/os-release
echo ${VERSION_ID}
)
install_apt $ubuntu_version
;;
*) # we can add more install command for each distros.
echo "\"$distro\" is not supported distro. Will search for 'apt' or 'dnf' package managers."