summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorJochen Topf <jochen@topf.org>2011-10-10 20:38:34 +0200
committerJochen Topf <jochen@topf.org>2011-10-10 20:38:34 +0200
commit37218f57f1b53a5f0b1a3d4e4444e8d80b5d667c (patch)
treecbd6b41d6696e7e7a2df009c6470df152b4b3dfe /bin
parent82c320568448206a65816cb602dfa8f8a3399c1e (diff)
downloadtaginfo-37218f57f1b53a5f0b1a3d4e4444e8d80b5d667c.tar
taginfo-37218f57f1b53a5f0b1a3d4e4444e8d80b5d667c.tar.gz
Add taginfo-config.rb to read config from command line.
I added bin/taginfo-config.rb to easily access the config file from the command line. This is now used in sources/db/update.sh and sources/update_all.sh. This, again, reduces the places in the distribution where things needed to be changed for each instance.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/taginfo-config.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/bin/taginfo-config.rb b/bin/taginfo-config.rb
new file mode 100755
index 0000000..fbeb163
--- /dev/null
+++ b/bin/taginfo-config.rb
@@ -0,0 +1,20 @@
+#!/usr/bin/ruby
+#
+# taginfo-config.rb [KEY]
+#
+
+require 'rubygems'
+require 'json'
+
+require File.expand_path(File.dirname(__FILE__)) + '/../web/lib/config.rb'
+
+TaginfoConfig.read
+
+value = TaginfoConfig.get(ARGV[0])
+if value.nil?
+ puts ''
+ exit 1
+end
+
+puts value
+