scripts: Improve UI 98/297798/1
authorŁukasz Stelmach <l.stelmach@samsung.com>
Thu, 10 Aug 2023 16:15:23 +0000 (18:15 +0200)
committerŁukasz Stelmach <l.stelmach@samsung.com>
Thu, 24 Aug 2023 10:16:50 +0000 (12:16 +0200)
Do not print newline after prompts for user interaction.

Reword some messages.

Change-Id: I53da243519860be91ef2cf1e240f084394982726
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
scripts/tizen/sd_fusing_rpi3.sh
scripts/tizen/sd_fusing_rpi4.sh
scripts/tizen/sd_fusing_vf2.sh

index 9eee17a..10fb3e7 100755 (executable)
@@ -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/<n>]"
+               echo -n "$(tput setaf 3)$(tput bold)$DEVICE is not a removable disk, Is it OK? [y/<n>] "
                tput sgr 0
                read input
                if [ "$input" != "y" ] && [ "$input" != "Y" ]; then
index ccd5498..05bd3a5 100755 (executable)
@@ -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/<n>]"
+               echo -n "$(tput setaf 3)$(tput bold)$DEVICE will be formatted, Is it OK? [y/<n>] "
                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/<n>]"
+               echo -n "$(tput setaf 3)$(tput bold)$DEVICE is not a removable disk, Is it OK? [y/<n>] "
                tput sgr 0
                read input
                if [ "$input" != "y" ] && [ "$input" != "Y" ]; then
index aba9e87..ccf82e9 100755 (executable)
@@ -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/<n>]"
+               echo -n "$(tput setaf 3)$(tput bold)$DEVICE will be formatted, Is it OK? [y/<n>] "
                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/<n>]"
+               echo -n "$(tput setaf 3)$(tput bold)$DEVICE is not a removable disk, Is it OK? [y/<n>] "
                tput sgr 0
                read input
                if [ "$input" != "y" ] && [ "$input" != "Y" ]; then