Skip to content

Commit

Permalink
make bin/jbdoc generate the docs if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
rbuels committed Mar 9, 2012
1 parent fc3ccfc commit 115b8cf
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions bin/jbdoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ use Cwd;
use File::Spec;
use File::Basename;

my $f = basename( $ARGV[0] || 'Browser', qr/\.[^.]*/) || 'Browser';
$f = File::Spec->catfile( 'docs', 'jsdoc', "$f.html" );
exec $ENV{BROWSER} || 'firefox', $f;
unless( -f html_file_for('Browser') ) {
system 'make -f Makefile.deploy docs';
}

exec $ENV{BROWSER} || 'firefox', html_file_for( $ARGV[0] );

###
sub html_file_for {
my ( $n ) = @_;
my $f = basename( $n, qr/\.[^.]*/);
return File::Spec->catfile( 'docs', 'jsdoc', "$f.html" );
}

0 comments on commit 115b8cf

Please sign in to comment.