Skip to content

Instantly share code, notes, and snippets.

@ugexe
Created March 17, 2016 21:37
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/e09c4af4910d17319216 to your computer and use it in GitHub Desktop.
Save ugexe/e09c4af4910d17319216 to your computer and use it in GitHub Desktop.
# Install a distribution in $*CWD
my $dist = Distribution::Path.new($*CWD);
my $CURI = CompUnit::RepositoryRegistry.repository-for-name("site");
$cur.install($dist);
# Distribution::<Meta Type>[does Distribution::Storage::<Storage Type>]
# Distribution::Hash[::Storage = Distribution::Storage::Directory].new(%meta-hash, path => $storage-path);
Distribution::Hash.new(%meta-hash, path => $*CWD);
Distribution::Hash[Distribution::Storage::GitHub].new(%meta-hash, uri => 'github.com/foo/bar');
# Distribution::Path[::Storage = Distribution::Storage::Directory].new($path-to-meta);
Distribution::Path.new($*CWD);
Distribution::Path[Distribution::Storage::GitHub].new($path-to-meta, uri => 'github.com/foo/bar');
# Distribution::Hash
my %provides =
"Test" => "lib/Test.pm6",
"NativeCall" => "lib/NativeCall.pm6",
"NativeCall::Types" => "lib/NativeCall/Types.pm6",
"NativeCall::Compiler::GNU" => "lib/NativeCall/Compiler/GNU.pm6",
"NativeCall::Compiler::MSVC" => "lib/NativeCall/Compiler/MSVC.pm6",
"Pod::To::Text" => "lib/Pod/To/Text.pm6",
"newline" => "lib/newline.pm6",
"experimental" => "lib/experimental.pm6",
;
my %meta =
name => "CORE",
auth => "perl",
ver => $*PERL.version.Str,
provides => %provides,
;
$*REPO.install: Distribution::Hash.new(%meta, :path($*CWD)), :force;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment