aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCem Keylan <cem@ckyln.com>2020-02-19 13:38:30 +0300
committerCem Keylan <cem@ckyln.com>2020-02-19 13:38:30 +0300
commit3c34167115e653f63e8e4036e3c03550ca296bc6 (patch)
treeb73b2a4ad1c6fb3d0b5d2a7c104aca82002143de
parentdc238623f0e653badc865d777b58137eaafe92d1 (diff)
downloadmkrootfs-3c34167115e653f63e8e4036e3c03550ca296bc6.tar.gz
modified message functions and removed out()
-rwxr-xr-xmkrootfs.sh36
1 files changed, 18 insertions, 18 deletions
diff --git a/mkrootfs.sh b/mkrootfs.sh
index 0fe3074..eb80f9c 100755
--- a/mkrootfs.sh
+++ b/mkrootfs.sh
@@ -4,11 +4,10 @@
# Functions
-out() { printf "%s\\n" "$@" ;}
-msg() { printf "\033[1;35m=>\033[m $1\\n" ;}
+msg() { printf '\033[1;35m=>\033[m %s\n' "$1" ;}
error() { msg "\033[1;31mERROR: \033[m$1" ;} >&2
die() { error "$1"; exit 1 ;}
-ask() { printf "\033[1;33m== $1 ==\\n(y/N) "; read ans; case "$ans" in [Yy]*) return 0 ;; *) return 1 ;; esac ;}
+ask() { printf '\033[1;33m== %s ==\\n(y/N) ' "$1" ; read ans; case "$ans" in [Yy]*) return 0 ;; *) return 1 ;; esac ;}
# Exit if the user is not root
@@ -29,22 +28,23 @@ BASEDIR="$PWD"
# Print variables from the configuration file
-out \
-"Here are the configuration values:" \
-"" \
-"MNTDIR = $MNTDIR" \
-"" \
-"Build Options" \
-"CFLAGS = $CFLAGS" \
-"CXXFLAGS = $CXXFLAGS" \
-"MAKEFLAGS = $MAKEFLAGS" \
-"" \
-"Repository and package options" \
-"" \
-"REPO = $REPO" \
-"REPOSITORY PATH = $HOST_REPO_PATH" \
-"PKGS = $PKGS"
+cat <<EOF
+Here are the configuration values:
+MNTDIR = $MNTDIR
+
+Build Options
+CFLAGS = $CFLAGS
+CXXFLAGS = $CXXFLAGS
+MAKEFLAGS = $MAKEFLAGS
+
+Repository and package options
+
+REPO = $REPO
+REPOSITORY PATH = $HOST_REPO_PATH
+PKGS = $PKGS
+
+EOF
# Check if there is no NOWELCOME variable set in
# the configuration file. If there is such variable