moved scripts to bin
This commit is contained in:
parent
b402de77a1
commit
88f83f0742
12 changed files with 138 additions and 207 deletions
20
bin/couchdir
Executable file
20
bin/couchdir
Executable file
|
@ -0,0 +1,20 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
unless ARGV.length >= 2
|
||||
puts "usage: couchdir path/to/directory db-name [docid]"
|
||||
exit
|
||||
end
|
||||
|
||||
require 'rubygems'
|
||||
require 'couchrest'
|
||||
|
||||
dirname = ARGV[0]
|
||||
dbname = ARGV[1]
|
||||
docid = ARGV[2]
|
||||
|
||||
puts "Create attachments for the files in #{dirname} in database #{dbname}."
|
||||
|
||||
fm = CouchRest::FileManager.new(dbname)
|
||||
fm.loud = true
|
||||
puts "Pushing views from directory #{dirname} to database #{fm.db}"
|
||||
fm.push_directory(dirname, docid)
|
Loading…
Add table
Add a link
Reference in a new issue