Permalink
Browse files

dist target for the makefile

  • Loading branch information...
1 parent 4a08e8d commit 3e83df6718d63cf36ca2d00f213a68f03115bee4 @frodwith committed Apr 28, 2011
Showing with 35 additions and 4 deletions.
  1. +4 −2 Makefile
  2. +29 −0 mkdist.pl
  3. +2 −2 package.json
View
@@ -2,7 +2,6 @@
coffee -cs < $< > $@
JSFILES := $(shell find . -name '*.coffee' | sed s/\.coffee$$/.js/)
-
coffee: $(JSFILES)
all: coffee
@@ -13,4 +12,7 @@ test: coffee
clean:
rm -f $(JSFILES)
-.PHONY : all test coffee
+dist:
+ perl mkdist.pl
+
+.PHONY : all test coffee dist
View
@@ -0,0 +1,29 @@
+use File::Find qw(find);
+use File::Spec;
+use Archive::Tar;
+use JSON;
+
+my @MANIFEST = qw(
+ LICENSE
+ README.markdown
+ package.json
+);
+
+find {
+ no_chdir => 1,
+ wanted => sub {
+ next if /\.git/;
+ push @MANIFEST, $_ if /\.js$/;
+ }
+}, '.';
+
+my $version = do {
+ open my $pkg, '<', 'package.json';
+ local $/;
+ JSON::decode_json(<$pkg>)->{version};
+};
+
+my $tar = Archive::Tar->new;
+$tar->add_files(@MANIFEST);
+my $name = "node-getopt-$version";
+$tar->write("$name.tar.gz", COMPRESS_GZIP, $name);
View
@@ -1,8 +1,8 @@
{
"name" : "getopt",
- "description" : "fixme",
+ "description" : "Powerful, flexible command-line option parsing for NodeJS",
"version" : "0.1.0",
- "bugs" : "mailto:frodwith@gmail.com",
+ "bugs" : "https://github.com/frodwith/node-getopt/issues",
"keywords" : [ "option", "parse", "commandline", "command", "line" ],
"main" : "./lib/getopt.js",
"directories" : {

0 comments on commit 3e83df6

Please sign in to comment.