Skip to content

Commit

Permalink
update depends to include test-depends
Browse files Browse the repository at this point in the history
  • Loading branch information
tony-o committed Feb 18, 2024
1 parent 334627d commit 46e1e1f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
9 changes: 5 additions & 4 deletions lib/Fez/CLI.rakumod
Original file line number Diff line number Diff line change
Expand Up @@ -959,16 +959,17 @@ multi MAIN('module', Str:D $mod, Bool:D :c(:$class) = False) is export {
$cwd.add('META6.json').spurt(to-j(%meta));
}

multi MAIN('dep', Str:D $dist, Bool :b(:$build) = False, Bool :r(:$remove) = False) is export {
MAIN('depends', $dist, :$build, :$remove);
multi MAIN('dep', Str:D $dist, Bool :b(:$build) = False, Bool :t(:$test) = False, Bool :r(:$remove) = False) is export {
MAIN('depends', $dist, :$build, :$test, :$remove);
}
multi MAIN('depends', Str:D $dist, Bool :b(:$build) = False, Bool :r(:$remove) = False) is export {
multi MAIN('depends', Str:D $dist, Bool :b(:$build) = False, Bool :t(:$test) = False, Bool :r(:$remove) = False) is export {
my $cwd = upcurse-meta();
log(FATAL, '-b(--build) and -t(--test) flags cannot be used together, choose one') if $test && $build;
log(FATAL, 'could not find META6.json') unless $cwd;
log(DEBUG, "found META6.json in {$cwd.relative}");

log(DEBUG, 'inspecting meta file');
my $dep-key = "{$build??'build-'!!''}depends";
my $dep-key = "{$build??'build-'!!$test??'test-'!!''}depends";
my %meta = from-j($cwd.add('META6.json').slurp);


Expand Down
6 changes: 4 additions & 2 deletions resources/usage/depends
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
USAGE

fez dep <dist> [-b]
fez dep <dist> [-b] [-t]

fez depends <dist> [--build=False]
fez depends <dist> [--build=False] [--test=False]

FLAGS

OPTIONAL

-b|--build adds the <dist> to build depends rather than
runtime depends
-t|--test adds the <dist> to test depends rather than
runtime depends

Adds a dependency to the META file.

0 comments on commit 46e1e1f

Please sign in to comment.