--- design/design-couch.pl 2009/04/26 20:18:17 30 +++ design/design-couch.pl 2009/04/26 21:37:40 31 @@ -46,22 +46,20 @@ } elsif ( $ref eq '' ) { $path =~ s{^/+}{}; - my $ext = ''; - if ( $tree =~ m{^\s*function}i ) { - $ext = '.js'; + $path .= '.js'; } elsif ( $tree =~ m{<\w+>} ) { - $ext = '.html'; + $path .= '.html'; } - write_file $path . $ext , $tree; + write_file $path, $tree; print "$path ", -s $path, " bytes\n"; } } my $json = $response->decoded_content; -write_file 'design.js', $json; +write_file "../$database-$design.js", $json; unroll( from_json $json, '/' );