scripts: Improve UI
authorŁukasz Stelmach <l.stelmach@samsung.com>
Thu, 10 Aug 2023 16:15:23 +0000 (18:15 +0200)
committerJaehoon Chung <jh80.chung@samsung.com>
Tue, 17 Oct 2023 11:02:46 +0000 (20:02 +0900)
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 9eee17affe05e788bb4a39c503da1728d4c8bdcb..10fb3e756aa2b24f8886d14db5a7566981073518 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 ccd549815a0ee04c389f4ae28f7e34696c7ed168..05bd3a5bf7afaee8e1ec293028b0d6bd891ec29e 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 aba9e87232d7609111bea116c99c4e6de6daec82..ccf82e91746481abd5a99e5e5470365919ced9e7 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