diff options
author | Yann E. MORIN" <yann.morin.1998@free.fr> | 2012-04-09 11:19:51 +0200 |
---|---|---|
committer | Yann E. MORIN" <yann.morin.1998@free.fr> | 2012-04-09 11:19:51 +0200 |
commit | 1db6c63e33b6846b6ffa462f8fd5d7fb7dd1a230 (patch) | |
tree | 989c77d249d2523b001aa22fff07feb23a81caf6 | |
parent | d7761401893497081a3d3542155d0a512a31ef86 (diff) | |
download | crosstool-ng-1db6c63e33b6846b6ffa462f8fd5d7fb7dd1a230.tar.gz crosstool-ng-1db6c63e33b6846b6ffa462f8fd5d7fb7dd1a230.tar.bz2 crosstool-ng-1db6c63e33b6846b6ffa462f8fd5d7fb7dd1a230.zip |
samples: . accepts previous comment as-is
When updating a sample configuration with a comment, a dot '.'
in the new comment keeps the previous comment.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
-rw-r--r-- | scripts/saveSample.sh.in | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/scripts/saveSample.sh.in b/scripts/saveSample.sh.in index 8967d54a..e8859721 100644 --- a/scripts/saveSample.sh.in +++ b/scripts/saveSample.sh.in @@ -121,14 +121,18 @@ exec >&7 [ -f "${samp_dir}/reported.by" ] && . "${samp_dir}/reported.by" old_name="${reporter_name}" old_url="${reporter_url}" +old_comment="${reporter_comment}" read -p "Reporter name [${reporter_name}]: " reporter_name read -p "Reporter URL [${reporter_url}]: " reporter_url if [ -n "${reporter_comment}" ]; then - echo "Old comment if you need to copy-paste:" - printf "${reporter_comment}\n" + echo "Old comment:" + printf "${reporter_comment}\n" |sed -r -e 's/^/ > /;' fi -echo "Reporter comment (Ctrl-D to finish):" +echo "Reporter comment (Ctrl-D to finish, '.' to use previous):" reporter_comment=$(cat) +if [ "${reporter_comment}" = "." ]; then + reporter_comment="${old_comment}" +fi ( echo "reporter_name=\"${reporter_name:=${old_name}}\"" echo "reporter_url=\"${reporter_url:=${old_url}}\"" |