From 86dac11a7d70ca940c85aeba2f3b580b4811d23c Mon Sep 17 00:00:00 2001 From: Ming Di Leom <2809763-curben@users.noreply.gitlab.com> Date: Sat, 20 May 2023 11:10:42 +0000 Subject: [PATCH] fix: check existent of busybox if dos2unix is not installed --- src/script.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/script.sh b/src/script.sh index ee5b08d..2bcfe3d 100644 --- a/src/script.sh +++ b/src/script.sh @@ -36,9 +36,16 @@ check_grep() { check_grep -## Fallback to busybox dos2unix -if ! command -v dos2unix &> /dev/null; then - alias dos2unix="busybox dos2unix" +## Fallback to busybox's dos2unix if installed +if ! command -v dos2unix &> /dev/null +then + if command -v busybox &> /dev/null + then + alias dos2unix="busybox dos2unix" + else + echo "dos2unix or busybox not found" + exit 1 + fi fi