Skip to content

Commit e7654d7

Browse files
committed
basic: fix: Fix missing progress report and error messages for the convenience variable configuration logic
Signed-off-by: 林博仁(Buo-ren, Lin) <Buo.Ren.Lin@gmail.com>
1 parent 3b297e8 commit e7654d7

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

basic.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,23 @@ if test "${flag_required_command_check_failed}" == true; then
4545
fi
4646

4747
if test -v BASH_SOURCE; then
48+
printf \
49+
'Info: Configuring the convenience variables...\n'
4850
# Convenience variables
4951
# shellcheck disable=SC2034
5052
{
51-
script="$(
53+
printf \
54+
'Info: Determining the absolute path of the program...\n'
55+
if ! script="$(
5256
realpath \
5357
--strip \
5458
"${BASH_SOURCE[0]}"
55-
)"
59+
)"; then
60+
printf \
61+
'Error: Unable to determine the absolute path of the program.\n' \
62+
1>&2
63+
exit 1
64+
fi
5665
script_dir="${script%/*}"
5766
script_filename="${script##*/}"
5867
script_name="${script_filename%%.*}"

0 commit comments

Comments
 (0)