diff --git a/src/mido.sh b/src/mido.sh index 4b418c8..b38f307 100644 --- a/src/mido.sh +++ b/src/mido.sh @@ -546,15 +546,13 @@ getESD() { else - cd "$dir" - - if ! cabextract "$file" > /dev/null; then - cd /run + if ! ( + cd "$dir" || exit 1 + cabextract "$file" > /dev/null + ); then error "Failed to extract $file!" && return 1 fi - cd /run - fi if [ ! -s "$dir/$xFile" ]; then