Skip to content

Commit f9a33fc

Browse files
committed
fix: fix hit helpers
1 parent 6a9878f commit f9a33fc

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

src/bundle/git.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
import simpleGit from 'simple-git'
22
import { info } from './utils'
33

4+
const git = simpleGit()
5+
46
export function fetchOrigin() {
5-
return simpleGit().fetch('origin')
7+
return git.fetch('origin')
68
}
79

8-
export function checkout(commit: string) {
10+
export async function checkout(commit: string) {
911
info(`Switch to ${commit}`)
10-
return simpleGit().raw(['switch', '--detach', commit])
12+
await git.checkout(commit)
1113
}
1214

1315
export async function gitRestore() {
14-
await simpleGit().raw(['restore', '.'])
15-
await simpleGit().raw(['switch', '-'])
16+
await git.raw(['switch', '-'])
1617
}

0 commit comments

Comments
 (0)