diff options
Diffstat (limited to '.ci/ci.cjs')
-rwxr-xr-x | .ci/ci.cjs | 23 |
1 files changed, 18 insertions, 5 deletions
@@ -302,7 +302,7 @@ var EmbeddedMetricsTraceable = class _EmbeddedMetricsTraceable extends Traceable } }; -// ../u/process/run.ts +// ../u/process/exec.ts var import_node_util = require("node:util"); var import_node_child_process = require("node:child_process"); var exec = (0, import_node_util.promisify)(import_node_child_process.exec); @@ -369,6 +369,10 @@ var Either = class _Either extends _Tagged2 { if (isRight(this.self)) return mapper(this.self.ok); return _Either.left(this.self.err); } + filter(mapper) { + if (isLeft(this.self)) return _Either.left(this.self.err); + return _Either.fromFailable(() => this.right().filter(mapper).get()); + } async flatMapAsync(mapper) { if (isLeft(this.self)) return Promise.resolve(_Either.left(this.self.err)); return await mapper(this.self.ok).catch((err) => _Either.left(err)); @@ -385,6 +389,15 @@ var Either = class _Either extends _Tagged2 { if (isRight(this.self)) return Optional.from(this.self.ok); return Optional.none(); } + joinRight(other, mapper) { + return this.flatMap((t) => other.mapRight((o) => mapper(o, t))); + } + joinRightAsync(other, mapper) { + return this.flatMapAsync(async (t) => { + const o = typeof other === "function" ? other() : other; + return o.then((other2) => other2.mapRight((o2) => mapper(o2, t))); + }); + } static left(e) { return new _Either({ err: e, _tag: ELeftTag }); } @@ -429,7 +442,7 @@ var Optional = class _Optional extends _Tagged3 { return this; } get() { - if (isNone(this.self)) throw new IOptionalEmptyError("empty value"); + if (isNone(this.self)) throw new IOptionalEmptyError("called get() on None optional"); return this.self.value; } filter(mapper) { @@ -478,10 +491,10 @@ var BasePipelineBuilder = class { } }; var DefaultGitHookPipelineBuilder = class extends BasePipelineBuilder { - constructor(remoteUrl = process.env.remote, rev = process.env.rev, ref = process.env.ref) { + constructor(remoteUrl = process.env.remote, rev = process.env.rev, refname = process.env.refname) { super(); this.remoteUrl = remoteUrl; - this.ref = ref; + this.refname = refname; this.addStage({ parallelJobs: [ { @@ -500,7 +513,7 @@ var DefaultGitHookPipelineBuilder = class extends BasePipelineBuilder { } getBranch() { const branchRefPrefix = "refs/heads/"; - return this.ref.split(branchRefPrefix).at(1); + return this.refname.split(branchRefPrefix).at(1); } }; |