Don't say you checked deps when you don't need them

I will not lie
This commit is contained in:
Jeroen De Meerleer 2020-02-12 18:54:28 +01:00
parent 53a732dd29
commit 2f39dc88e4
1 changed files with 42 additions and 34 deletions

View File

@ -52,7 +52,7 @@ script_name=$(basename "${0}")
script_dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
CheckDeps() {
if [[ $1 == 0 ]]; then
if [[ $1 == 2 ]]; then
# Check getopt
! getopt --test > /dev/null
if [[ ${PIPESTATUS[0]} -ne 4 ]]; then
@ -67,48 +67,56 @@ CheckDeps() {
if [[ $1 == 1 ]]; then
# Check ffmpeg
if [[ $convert == true && ! $(ffmpeg -h 2>/dev/null) ]]; then
VerboseOutput 5 "\`ffmpeg -h\` failed"
VerboseOutput 5 "Sorry, It seems that ffmpeg is not installed on your system"
VerboseOutput 5 "Please install ffmpeg from your repositories and make sure it is available in your \$PATH"
VerboseOutput 5 "Otherwise disable conversion"
ExecTime
exit 1
if [[ $convert == true ]]; then
if [[ ! $(ffmpeg -h 2>/dev/null) ]]; then
VerboseOutput 5 "\`ffmpeg -h\` failed"
VerboseOutput 5 "Sorry, It seems that ffmpeg is not installed on your system"
VerboseOutput 5 "Please install ffmpeg from your repositories and make sure it is available in your \$PATH"
VerboseOutput 5 "Otherwise disable conversion"
ExecTime
exit 1
fi
VerboseOutput 0 "\`ffmpeg -h\` succeeded"
fi
VerboseOutput 0 "\`ffmpeg -h\` succeeded"
# Check EyeD3
if [[ $convertart == true && ! $(eyeD3 --version 2>/dev/null) ]]; then
VerboseOutput 5 "\`eyeD3 --version\` failed"
VerboseOutput 5 "Sorry, It seems that eyeD3 is not installed on your system"
VerboseOutput 5 "Please install eyeD3 from your repositories and make sure it is available in your \$PATH"
VerboseOutput 5 "Otherwise disable albumart conversion"
ExecTime
exit 1
if [[ $convertart == true ]]; then
if [[ ! $(eyeD3 --version 2>/dev/null) ]]; then
VerboseOutput 5 "\`eyeD3 --version\` failed"
VerboseOutput 5 "Sorry, It seems that eyeD3 is not installed on your system"
VerboseOutput 5 "Please install eyeD3 from your repositories and make sure it is available in your \$PATH"
VerboseOutput 5 "Otherwise disable albumart conversion"
ExecTime
exit 1
fi
VerboseOutput 0 "\`eyeD3 --version\` succeeded"
fi
VerboseOutput 0 "\`eyeD3 --version\` succeeded"
# Check ImageMagick
if [[ $convertart == true && ! $(convert --version 2>/dev/null) ]]; then
VerboseOutput 5 "\`convert --version\` failed"
VerboseOutput 5 "Sorry, It seems that ImageMagick is not installed on your system"
VerboseOutput 5 "Please install ImageMagick from your repositories and make sure it is available in your \$PATH"
VerboseOutput 5 "Otherwise disable albumart conversion"
ExecTime
exit 1
if [[ $convertart == true ]]; then
if [[ ! $(convert --version 2>/dev/null) ]]; then
VerboseOutput 5 "\`convert --version\` failed"
VerboseOutput 5 "Sorry, It seems that ImageMagick is not installed on your system"
VerboseOutput 5 "Please install ImageMagick from your repositories and make sure it is available in your \$PATH"
VerboseOutput 5 "Otherwise disable albumart conversion"
ExecTime
exit 1
fi
VerboseOutput 0 "\`convert --version\` succeeded"
fi
VerboseOutput 0 "\`convert --version\` succeeded"
# Check Gnu parallel
if [[ $multithread == true && ! $(parallel -h 2>/dev/null) ]]; then
VerboseOutput 5 "\`parallel -h\` failed"
VerboseOutput 5 "Sorry, It seems that parallel is not installed on your system"
VerboseOutput 5 "Please install gnu-parallel and env_parallel from your repositories and make sure it is available in your \$PATH"
VerboseOutput 5 "Otherwise disable multithreading"
ExecTime
exit 1
if [[ $multithread == true ]]; then
if [[ ! $(parallel -h 2>/dev/null) ]]; then
VerboseOutput 5 "\`parallel -h\` failed"
VerboseOutput 5 "Sorry, It seems that parallel is not installed on your system"
VerboseOutput 5 "Please install gnu-parallel and env_parallel from your repositories and make sure it is available in your \$PATH"
VerboseOutput 5 "Otherwise disable multithreading"
ExecTime
exit 1
fi
VerboseOutput 0 "\`parallel -h \` succeeded"
fi
VerboseOutput 0 "\`parallel -h \` succeeded"
fi
VerboseOutput 1 "Dependency test OK"
}
@ -442,7 +450,7 @@ ExitHandler() {
trap 'ExitHandler' SIGINT
trap 'ErrorHandler $BASH_COMMAND' ERR
CheckDeps 0
CheckDeps 2
GetOptions $@
CheckDeps 1
if [[ $help == true ]]; then