Skip to content

Commit

Permalink
Minor cleanups and comment improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
japhb committed May 11, 2013
1 parent ce2ed23 commit 015c246
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions bench
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use Shell::Command;


# Reduce directory insanity a bit by changing to bench root
# and eliminating hardcoding for generated subdir names
my $PROGRAM_DIR = ~($*PROGRAM_NAME ~~ /^(.*\/)/) || './';
chdir $PROGRAM_DIR;
$PROGRAM_DIR = cwd;
Expand Down Expand Up @@ -49,7 +50,7 @@ multi MAIN ('setup') {
my $bare = "$name.git";
say "----> Already cloned." if $bare.path.d && $name.path.d;
run < git clone --mirror >, $repo, $bare unless $bare.path.d;
run < git clone -l >, $bare, $name unless $name.path.d;
run < git clone -l >, $bare, $name unless $name.path.d;
}

say 'Setup complete.';
Expand Down Expand Up @@ -235,24 +236,26 @@ multi MAIN ('realclean', Bool :$force) {
run < git clean -dxf >;
}

#= Perform benchmark timings
#= Perform benchmark timings (low-level command)
multi MAIN ('timeall', *@options) {
run('./timeall', |@options);
}

#= Analyze results from benchmark timings
#= Analyze results from benchmark timings (low-level command)
multi MAIN ('analyze', *@options_and_files) {
run('./analyze', |@options_and_files);
}


# UTILITY ROUTINES

#= Check whether 'setup' command has been run and bail out if not
#= Check whether components dir exists and bail out if not (recommending 'setup' command)
sub needs-setup ($action) {
unless $COMPONENTS_DIR.path.d {
say "There is no 'components' tree, and thus there are no repos to $action.";
say "Please run `$*PROGRAM_NAME setup`.";
print qq:to/COMPONENTS/;
There is no '{ $COMPONENTS_DIR.path.basename }' tree, and thus there are no repos to $action.
Please run: `$*PROGRAM_NAME setup`.
COMPONENTS
exit 1;
}
}
Expand Down

0 comments on commit 015c246

Please sign in to comment.