This commit is contained in:
12
src/git.ts
12
src/git.ts
@@ -36,6 +36,18 @@ export class GitBranchRef extends GitRef {}
|
||||
export class GitTagRef extends GitRef {}
|
||||
|
||||
|
||||
export const gitFetch = pipe(
|
||||
SimpleGitService,
|
||||
|
||||
Effect.flatMap(git =>
|
||||
Effect.tryPromise({
|
||||
try: () => git.fetch(),
|
||||
catch: mapSimpleGitErrors,
|
||||
})
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
export class GitRefNullNameError {}
|
||||
|
||||
export const getGitRefName = pipe(
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Console, Context, Effect, pipe } from "effect"
|
||||
import simpleGit from "simple-git"
|
||||
import { parseArgv } from "./argv"
|
||||
import { parseEnv } from "./env"
|
||||
import { SimpleGitService, getGitRef } from "./git"
|
||||
import { SimpleGitService, getGitRef, gitFetch } from "./git"
|
||||
import { DefaultMatcher, SemVerMatcher, generateDockerTagsFromGitRef } from "./matchers"
|
||||
import { writeDockerTagsFile } from "./tags"
|
||||
|
||||
@@ -19,7 +19,8 @@ const context = Context.empty().pipe(
|
||||
)
|
||||
|
||||
const main = pipe(
|
||||
getGitRef,
|
||||
gitFetch,
|
||||
Effect.flatMap(() => getGitRef),
|
||||
|
||||
Effect.flatMap(ref => generateDockerTagsFromGitRef(ref, [
|
||||
new SemVerMatcher,
|
||||
|
||||
Reference in New Issue
Block a user