global enhancements
- create context object and remove github one - more tests and improve mocks Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import * as exec from '@actions/exec';
|
||||
|
||||
import {Buildx} from './buildx';
|
||||
import {Context} from './context';
|
||||
|
||||
export interface BuilderInfo {
|
||||
name?: string;
|
||||
@@ -20,14 +21,21 @@ export interface NodeInfo {
|
||||
}
|
||||
|
||||
export interface BuilderOpts {
|
||||
context: Context;
|
||||
buildx?: Buildx;
|
||||
}
|
||||
|
||||
export class Builder {
|
||||
private buildx: Buildx;
|
||||
private readonly context: Context;
|
||||
private readonly buildx: Buildx;
|
||||
|
||||
constructor(opts?: BuilderOpts) {
|
||||
this.buildx = opts?.buildx || new Buildx();
|
||||
constructor(opts: BuilderOpts) {
|
||||
this.context = opts.context;
|
||||
this.buildx =
|
||||
opts?.buildx ||
|
||||
new Buildx({
|
||||
context: this.context
|
||||
});
|
||||
}
|
||||
|
||||
public async inspect(name: string): Promise<BuilderInfo> {
|
||||
|
||||
Reference in New Issue
Block a user