restart etc
This commit is contained in:
parent
58c6b7ee8a
commit
a12ad9c4ea
4 changed files with 192 additions and 1 deletions
|
@ -1,7 +1,15 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
unless ARGV.length >= 2
|
||||
puts "usage: couchdir path/to/directory db-name"
|
||||
exit
|
||||
end
|
||||
|
||||
dirname = ARGV[0].sub(/\/$/,'')
|
||||
dbname = ARGV[1]
|
||||
|
||||
|
||||
|
||||
puts "Shoving #{dirname} into #{dbname}."
|
||||
|
||||
require File.expand_path(File.dirname(__FILE__)) + '/../couchrest'
|
||||
|
@ -34,6 +42,8 @@ puts attachments.keys.inspect
|
|||
|
||||
doc = @db.get(dirname) rescue nil
|
||||
|
||||
# puts "get: #{doc.inspect}"
|
||||
|
||||
if doc
|
||||
doc["_attachments"] = attachments
|
||||
else
|
||||
|
@ -43,5 +53,6 @@ else
|
|||
}
|
||||
end
|
||||
|
||||
|
||||
# puts "saving: #{doc.inspect}"
|
||||
@db.save(doc)
|
||||
puts "saved"
|
Loading…
Add table
Add a link
Reference in a new issue