Skip to main content
Module

x/denoversion/git.ts

Deno cli to manage and bump release versions.
Latest
File
import { run } from "deno";export async function gitCheckCleanState() { const git = run({ args: ["git", "diff", "--quiet"], stdout: "piped" }); const status = await git.status(); return status.success;}
export async function gitCommitFileChanges(fileName: string, message: string) { const git = run({ args: ["git", "commit", "-m", message, fileName] });
const status = await git.status(); if (!status.success) { throw new Error(`Error ${status.code} creating git commit.`); }}
export async function gitCreateTag(name: string, msg: string) { const git = run({ args: ["git", "tag", "-a", name, "-m", msg] });
const status = await git.status(); if (!status.success) { throw new Error(`Error ${status.code} creating git tag.`); }}
export async function gitPushWithTags() { const git = run({ args: ["git", "push", "--follow-tags"] });
const status = await git.status(); if (!status.success) { throw new Error(`Error ${status.code} pushing to remote.`); }}