never add _id, _rev and rest of _private variables to svn, create database if needed
[pxelator] / couchdb / design-couch.pl
index e5cdf10..948f31d 100755 (executable)
@@ -46,7 +46,7 @@ sub create_path {
 
 sub svn {
        my $path = shift;
-       return if $path =~ m{(_rev|.*\.(push|pull)\.js)$};
+       return if $path =~ m{(_.*|.*\.(push|pull)\.js)$};
        system "svn add --parents $path";
 }
 
@@ -112,6 +112,8 @@ if ( $command eq 'pull' ) {
 
 } elsif ( $command eq 'push' ) {
 
+       $ua->request( HTTP::Request::Common::PUT( "http://localhost:5984/$database" ) ) && warn "# created database $database\n";
+
        my $json;
 
        find({ no_chdir => 1, wanted => sub {