something something git
This commit is contained in:
@@ -11,7 +11,7 @@ const rmrf = (path:string, options = {}) => {
|
||||
return new Promise((acc, _) => rimraf(path, options, acc))
|
||||
}
|
||||
|
||||
type RepoFolderStatus = {
|
||||
export type RepoFolderStatus = {
|
||||
exists: boolean
|
||||
empty: boolean
|
||||
currentTag?: string
|
||||
@@ -53,6 +53,8 @@ export class GitUpdater{
|
||||
}
|
||||
|
||||
async cloneRepo(from:string, force:boolean = false):Promise<RepoFolderStatus> {
|
||||
if(this.folderPath === "." && force)
|
||||
throw new Error("refusing to `rm -rf .`: \ncloneRepo(from: "+from+", force: "+force+")")
|
||||
if(force){
|
||||
await rmrf(this.folderPath)
|
||||
await fs.mkdir(this.folderPath, { recursive: true });
|
||||
|
||||
Reference in New Issue
Block a user