[Groonga-commit] droonga/droonga-engine at 7b644cb [master] Extract logic to wait user input

Back to archive index

YUKI Hiroshi yuki****@clear*****
Tue Sep 16 14:15:22 JST 2014


ありがとうございます!

Kouhei Sutou wrote:
>> +  while read TYPED_HOSTNAME; do
>> +    if [ "$TYPED_HOSTNAME" != "" ]; then break; fi
>> +    echo -n "$prompt"
> 
> readには-pというオプションがあって、それでプロンプトを出せま
> すよ。
> 
> In <7b644cbd9568ba3cf313dcab3a9c7141de4d4528 �� jenkins.clear-code.com>
>   "[Groonga-commit] droonga/droonga-engine �� 7b644cb [master] Extract logic to wait user input" on Tue, 16 Sep 2014 13:40:32 +0900,
>   YUKI Hiroshi <null+groonga �� clear-code.com> wrote:
> 
>> YUKI Hiroshi	2014-09-16 13:40:32 +0900 (Tue, 16 Sep 2014)
>>
>>   New Revision: 7b644cbd9568ba3cf313dcab3a9c7141de4d4528
>>   https://github.com/droonga/droonga-engine/commit/7b644cbd9568ba3cf313dcab3a9c7141de4d4528
>>
>>   Message:
>>     Extract logic to wait user input
>>
>>   Modified files:
>>     install.sh
>>
>>   Modified: install.sh (+12 -6)
>> ===================================================================
>> --- install.sh    2014-09-16 13:10:36 +0900 (c7ac562)
>> +++ install.sh    2014-09-16 13:40:32 +0900 (c65a102)
>> @@ -127,17 +127,23 @@ determine_hostname() {
>>    done
>>  
>>    if [ "$DETERMINED_HOSTNAME" = "Manual Input" ]; then
>> -    prompt="$prompt_for_manual_input: "
>> -    echo -n "$prompt"
>> -    while read DETERMINED_HOSTNAME; do
>> -      if [ "$DETERMINED_HOSTNAME" != "" ]; then break; fi
>> -      echo -n "$prompt"
>> -    done
>> +    input_hostname "$prompt_for_manual_input" &&
>> +      DETERMINED_HOSTNAME="$TYPED_HOSTNAME"
>>    fi
>>  
>>    return 0
>>  }
>>  
>> +input_hostname() {
>> +  prompt="$1: "
>> +  echo -n "$prompt"
>> +  while read TYPED_HOSTNAME; do
>> +    if [ "$TYPED_HOSTNAME" != "" ]; then break; fi
>> +    echo -n "$prompt"
>> +  done
>> +  return 0
>> +}
>> +
>>  
>>  install_rroonga() {
>>    # Install Rroonga globally from a public gem, because custom build
> 
> _______________________________________________
> Groonga-commit mailing list
> Groonga-commit �� lists.sourceforge.jp
> http://lists.sourceforge.jp/mailman/listinfo/groonga-commit
> 

-- 
結城 洋志 <YUKI Hiroshi>
E-mail: yuki �� clear-code.com

株式会社クリアコード
〒170-0005 東京都豊島区南大塚3-29-9
           中野ビル3階
TEL : 03-5927-9440
FAX : 03-5927-9441
WWW : http://www.clear-code.com/




More information about the Groonga-commit mailing list
Back to archive index