el/dot-emacs.el (mdw-regexp): Sort the input list.
[profile] / firefox / explode-stylus
index 6dde67c..1b20b83 100755 (executable)
@@ -1,10 +1,11 @@
 #! /usr/bin/perl
 
 use autodie;
+use POSIX qw{:errno_h};
 use JSON;
 
 my ($dir) = @ARGV;
-mkdir $dir;
+eval { mkdir $dir; }; die if $@ && $@->errno != EEXIST;
 
 local $/;
 my $js = decode_json <STDIN>;
@@ -17,6 +18,7 @@ for my $e (@$js) {
       next KEY if $k eq "code";
       print $fh "/*@ $k: ", join(", ", $s->{$k}->@*), " */\n";
     }
+    $s->{code} =~ s/\n$//;
     print $fh $s->{code}, "\n";
     print $fh "/*\@END*/\n";
   }