From 7395c956f976c92793441833d92eeadd5bf2b251 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C5=81ukasz=20Stelmach?= Date: Thu, 10 Aug 2023 18:15:23 +0200 Subject: [PATCH] scripts: Improve UI MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Do not print newline after prompts for user interaction. Reword some messages. Change-Id: I53da243519860be91ef2cf1e240f084394982726 Signed-off-by: Łukasz Stelmach --- scripts/tizen/sd_fusing_rpi3.sh | 4 ++-- scripts/tizen/sd_fusing_rpi4.sh | 8 ++++---- scripts/tizen/sd_fusing_vf2.sh | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/tizen/sd_fusing_rpi3.sh b/scripts/tizen/sd_fusing_rpi3.sh index 9eee17a..10fb3e7 100755 --- a/scripts/tizen/sd_fusing_rpi3.sh +++ b/scripts/tizen/sd_fusing_rpi3.sh @@ -84,7 +84,7 @@ function fusing_image () { local -r device=/dev/`lsblk ${DEVICE} -o TYPE,KNAME | awk "/^${blktype}.*[a-z]${num}\$/ { print \\\$2 }"` local -r bs=${PART_TABLE[${part_idx} * ${PART_TABLE_COL} + 2]} else - echo "Not supported binary: $fusing_img" + echo "Unsupported binary: $fusing_img" return fi @@ -408,7 +408,7 @@ function check_device () { local REMOVABLE=`lsblk $DEVICE -nd -o RM | grep 1 | wc -l` if [ "$REMOVABLE" == "0" ]; then echo "" - echo "$(tput setaf 3)$(tput bold)$DEVICE is not a removable disk, Is it OK? [y/]" + echo -n "$(tput setaf 3)$(tput bold)$DEVICE is not a removable disk, Is it OK? [y/] " tput sgr 0 read input if [ "$input" != "y" ] && [ "$input" != "Y" ]; then diff --git a/scripts/tizen/sd_fusing_rpi4.sh b/scripts/tizen/sd_fusing_rpi4.sh index ccd5498..05bd3a5 100755 --- a/scripts/tizen/sd_fusing_rpi4.sh +++ b/scripts/tizen/sd_fusing_rpi4.sh @@ -119,7 +119,7 @@ function fusing_image () { local -r device=/dev/`lsblk ${DEVICE} -o TYPE,KNAME | awk "/^${blktype}.*[a-z]${num}\$/ { print \\\$2 }"` local -r bs=${PART_TABLE[${part_idx} * ${PART_TABLE_COL} + 2]} else - echo "Not supported binary: $fusing_img" + echo "Unsupported binary: $fusing_img" return fi @@ -162,7 +162,7 @@ function fusing_image_to_b () { local -r device=/dev/`lsblk ${DEVICE} -o TYPE,KNAME | awk "/^${blktype}.*[a-z]${num}\$/ { print \\\$2 }"` local -r bs=${PART_TABLE_B[${part_idx} * ${PART_TABLE_COL} + 2]} else - echo "Not supported binary: $fusing_img" + echo "Unsupported binary: $fusing_img" return fi @@ -493,7 +493,7 @@ function check_args () { if [ "$FORMAT" == "1" ]; then echo "" - echo "$(tput setaf 3)$(tput bold)$DEVICE will be formatted, Is it OK? [y/]" + echo -n "$(tput setaf 3)$(tput bold)$DEVICE will be formatted, Is it OK? [y/] " tput sgr 0 read input if [ "$input" == "y" ] || [ "$input" == "Y" ]; then @@ -515,7 +515,7 @@ function check_device () { local REMOVABLE=`lsblk $DEVICE -nd -o RM | grep 1 | wc -l` if [ "$REMOVABLE" == "0" ]; then echo "" - echo "$(tput setaf 3)$(tput bold)$DEVICE is not a removable disk, Is it OK? [y/]" + echo -n "$(tput setaf 3)$(tput bold)$DEVICE is not a removable disk, Is it OK? [y/] " tput sgr 0 read input if [ "$input" != "y" ] && [ "$input" != "Y" ]; then diff --git a/scripts/tizen/sd_fusing_vf2.sh b/scripts/tizen/sd_fusing_vf2.sh index aba9e87..ccf82e9 100755 --- a/scripts/tizen/sd_fusing_vf2.sh +++ b/scripts/tizen/sd_fusing_vf2.sh @@ -88,7 +88,7 @@ function fusing_image () { local -r device=/dev/`lsblk ${DEVICE} -o TYPE,KNAME | awk "/^${blktype}.*[a-z]${num}\$/ { print \\\$2 }"` local -r bs=${PART_TABLE[${part_idx} * ${PART_TABLE_COL} + 2]} else - echo "Not supported binary: $fusing_img" + echo "Unsupported binary: $fusing_img" return fi @@ -343,7 +343,7 @@ function check_args () { if [ "$FORMAT" == "1" ]; then echo "" - echo "$(tput setaf 3)$(tput bold)$DEVICE will be formatted, Is it OK? [y/]" + echo -n "$(tput setaf 3)$(tput bold)$DEVICE will be formatted, Is it OK? [y/] " tput sgr 0 read input if [ "$input" == "y" ] || [ "$input" == "Y" ]; then @@ -365,7 +365,7 @@ function check_device () { local REMOVABLE=`lsblk $DEVICE -nd -o RM | grep 1 | wc -l` if [ "$REMOVABLE" == "0" ]; then echo "" - echo "$(tput setaf 3)$(tput bold)$DEVICE is not a removable disk, Is it OK? [y/]" + echo -n "$(tput setaf 3)$(tput bold)$DEVICE is not a removable disk, Is it OK? [y/] " tput sgr 0 read input if [ "$input" != "y" ] && [ "$input" != "Y" ]; then -- 2.7.4