({
cwd,
short = false,
}: {
cwd: string;
short?: boolean;
})
| 294 | } |
| 295 | |
| 296 | export async function getCurrentCommitId({ |
| 297 | cwd, |
| 298 | short = false, |
| 299 | }: { |
| 300 | cwd: string; |
| 301 | short?: boolean; |
| 302 | }): Promise<string> { |
| 303 | return ( |
| 304 | await spawn( |
| 305 | "git", |
| 306 | ["rev-parse", short && "--short", "HEAD"].filter<string>(Boolean as any), |
| 307 | { cwd } |
| 308 | ) |
| 309 | ).stdout |
| 310 | .toString() |
| 311 | .trim(); |
| 312 | } |
| 313 | |
| 314 | export async function remoteTagExists(tagStr: string) { |
| 315 | const gitCmd = await spawn("git", [ |
no outgoing calls