Merge pull request #17 from white-gecko/feature/check_sudo_dependency

Introduce check_sudo_dependency.
This commit is contained in:
Adam Pigg 2021-03-06 11:11:31 +00:00 committed by GitHub
commit 801d0287fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 3 deletions

View File

@ -88,6 +88,13 @@ function check_dependency {
}
}
# Add sbin to the PATH to check for commands available to sudo
function check_sudo_dependency {
dependency=$1
local PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin
check_dependency $dependency
}
# Determine if wget supports the --show-progress option (introduced in
# 1.16). If so, make use of that instead of spewing out redirects and
# loads of info into the terminal.
@ -105,14 +112,14 @@ function wget_cmd {
}
# Check dependencies
check_dependency "parted"
check_dependency "sudo"
check_dependency "wget"
check_dependency "tar"
check_dependency "unzip"
check_dependency "lsblk"
check_dependency "mkfs.ext4"
check_dependency "losetup"
check_sudo_dependency "parted"
check_sudo_dependency "mkfs.ext4"
check_sudo_dependency "losetup"
# If use custom dir check it
if [ "$CUSTOM" != "" ]; then