Skip to content

Instantly share code, notes, and snippets.

@ugexe
Last active December 2, 2016 04:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ugexe/aaa74c735e585f12f76d6efe0daec848 to your computer and use it in GitHub Desktop.
Save ugexe/aaa74c735e585f12f76d6efe0daec848 to your computer and use it in GitHub Desktop.
#! perl
use warnings;
use strict;
my $perl6bin = shift @ARGV;
my $zefbin = shift @ARGV;
my $exit = 0;
my $path_sep = "/";
$path_sep = "\\" if ( $^O eq 'MSWin32' );
my @module_paths;
while (<>) {
next if /^\s*(#|$)/;
my ($module) = /(\S+)/;
push @module_paths, "./modules$path_sep$module";
}
exit system $perl6bin, $zefbin,
'--/build-depends', '--/test-depends', '--/depends',
'--/p6c', '--/metacpan', '--/cpan',
'install', @module_paths;
#! perl
use warnings;
use strict;
my $perl6bin = shift @ARGV;
my $zefbin = shift @ARGV;
my $exit = 0;
my $path_sep = "/";
$path_sep = "\\" if ( $^O eq 'MSWin32' );
my @module_paths;
while (<>) {
next if /^\s*(#|$)/;
my ($module) = /(\S+)/;
push @module_paths, "./modules$path_sep$module";
}
# Alternatively test first without --force...
exit 255 if system $perl6bin, $zefbin,
'--/build-depends', '--/test-depends', '--/depends',
'--/p6c', '--/metacpan', '--/cpan',
'test', @module_paths;
# ... and install with --force if the tests passed
# (and skip testing again)
exit system $perl6bin, $zefbin,
'--/build-depends', '--/test-depends', '--/depends',
'--/p6c', '--/metacpan', '--/cpan',
'--force', '--/test', install', @module_paths;
# or if you prefer installing one by one
#foreach my $m (@module_paths) {
# exit 255 if system $perl6bin, $zefbin,
# '--/build-depends', '--/test-depends', '--/depends',
# '--/p6c', '--/metacpan', '--/cpan',
# '--force', '--/test', 'install', $m;
#}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment