Skip to content

Commit 58424c5

Browse files
committed
Give positive feedback when utilities pass
1 parent 854c8ec commit 58424c5

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
function app:ensure {
2-
if [ ! $(which "$1") ]; then
1+
function app:ensure { # Abort if the desired program is not installed
2+
if [ ! $(which "$1") ]; then
33
echo "Missing required application ${RED}$1${RESET}. Install it before tying again."
44
exit 1
5-
fi
5+
else
6+
echo "Application ${GREEN}$1${RESET} is installed.";
7+
fi
68
}

src/components/Generator/GeneredTaskfile/addons/fileUtilities/file-utilities.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@ function file:ensure { # Abort if the desired file is not found
22
if [ ! -f $1 ]; then
33
echo -e "Missing required file ${RED}$1${RESET}, make sure it is created."
44
exit 1
5+
else
6+
echo "File ${GREEN}$1${RESET} is present.";
57
fi
68
}
79

8-
function file:ensure-copy { # file:ensure-copy $COPY_TARGET $COPY_SOURCE
9-
if [ ! -f $1 ]; then
10+
function file:ensure-copy { # file:ensure-copy $COPY_DESTINATION $SOURCE
11+
if [ ! -f $1 ]; then
1012
cp $2 $1;
1113
echo -e "Created copy of ${YELLOW}$2${RESET} to create required file ${GREEN}$1${RESET}.";
1214
else
1315
echo "File ${GREEN}$1${RESET} is present.";
14-
fi
16+
fi
1517
}

0 commit comments

Comments
 (0)