Skip to content
Permalink
Browse files

Make lazy project loader work for generators

[changelog:fixed]
  • Loading branch information...
cdupuis committed Jan 22, 2019
1 parent efa8751 commit 2e0ed3ec205237b4d28d0b78eb93e3cc60e83657
@@ -20,6 +20,10 @@ import {
RemoteRepoRef,
} from "@atomist/automation-client";
import { RepoLoader } from "@atomist/automation-client/lib/operations/common/repoLoader";
import {
isLazyProjectLoader,
LazyProject,
} from "../../spi/project/LazyProjectLoader";
import { ProjectLoader } from "../../spi/project/ProjectLoader";

/**
@@ -35,8 +39,12 @@ export function projectLoaderRepoLoader(pl: ProjectLoader,
context?: HandlerContext): RepoLoader {
return async id => {
let project;

await pl.doWithProject({ id: id as RemoteRepoRef, credentials, readOnly, context },
async p => {
if (isLazyProjectLoader(pl)) {
await (p as any as LazyProject).materialize();
}
project = p;
});
return project;
@@ -93,7 +93,7 @@ class GitHubLazyProject extends AbstractProject implements GitProject, LazyProje
return this.materialized() ? this.projectPromise.result().provenance : "unavailable";
}

public release: ReleaseFunction = () => undefined;
public release: ReleaseFunction = () => Promise.resolve();

get baseDir(): string {
if (!this.materialized()) {

0 comments on commit 2e0ed3e

Please sign in to comment.
You can’t perform that action at this time.