(cwd: string)
| 1 | import { execWithOutput } from "./utils"; |
| 2 | |
| 3 | export const getCurrentBranch = async (cwd: string) => { |
| 4 | const { stdout } = await execWithOutput( |
| 5 | "git", |
| 6 | ["rev-parse", "--abbrev-ref", "HEAD"], |
| 7 | { cwd } |
| 8 | ); |
| 9 | return stdout.trim(); |
| 10 | }; |
| 11 | |
| 12 | export const pullBranch = async (branch: string, cwd: string) => { |
| 13 | await execWithOutput("git", ["pull", "origin", branch], { cwd }); |