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

Back to archive index

YUKI Hiroshi null+****@clear*****
Tue Sep 16 13:40:32 JST 2014


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
-------------- next part --------------
HTML����������������������������...
Download 



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