[Groonga-commit] groonga/gcs [master] Improve example.sdf.json detection

Back to archive index

null+****@clear***** null+****@clear*****
2012年 7月 4日 (水) 23:01:22 JST


Kouhei Sutou	2012-07-04 23:01:22 +0900 (Wed, 04 Jul 2012)

  New Revision: 0202e8b6edc159601ec5aa28808f99aadc04632e
  https://github.com/groonga/gcs/commit/0202e8b6edc159601ec5aa28808f99aadc04632e

  Log:
    Improve example.sdf.json detection

  Modified files:
    bin/gcs-import-examples

  Modified: bin/gcs-import-examples (+11 -1)
===================================================================
--- bin/gcs-import-examples    2012-07-04 18:38:22 +0900 (d7feda5)
+++ bin/gcs-import-examples    2012-07-04 23:01:22 +0900 (d0e431c)
@@ -46,7 +46,17 @@ echo
 
 echo
 echo "==== Indexing data"
-sdf_path=`npm -g root`/gcs/examples/example.sdf.json
+sdf_path=
+sdf_base_path=examples/example.sdf.json
+for sdf_path_prefix in "`dirname $0`/.." "`npm root`/gcs" "`npm -g root`/gcs"
+do
+    sdf_path="$sdf_path_prefix/$sdf_base_path"
+    if [ -f "$sdf_path" ]; then
+	break
+    else
+	sdf_path=
+    fi
+done
 
 curl -X POST --upload-file $sdf_path --header "Content-Type: application/json" -H "Host: doc-example-00000000000000000000000000.localhost" http://127.0.0.1:7575/2011-02-01/documents/batch
 echo
-------------- next part --------------
HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B...
Download 



Groonga-commit メーリングリストの案内
Back to archive index