Skip to content

Commit

Permalink
add clean temp files before exit
Browse files Browse the repository at this point in the history
  • Loading branch information
startpenghubingzhou committed Dec 3, 2019
1 parent 6edefd6 commit e4ab43b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
Binary file not shown.
1 change: 0 additions & 1 deletion AnywhereEFI/efiupdater.swift
Original file line number Diff line number Diff line change
Expand Up @@ -148,5 +148,4 @@ func efiupdatermain(){
}
}

//https://github.com/Dids/clover-builder/releases/download/v2.5k_r5099/Clover_v2.5k_r5099.pkg

11 changes: 10 additions & 1 deletion AnywhereEFI/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,21 @@ func forinit() {
efiupdatermain()
case 4:
print("Thanks for using, good bye!")
exit(0)
forexit()
default:
break
}
}

//Some work to clean temp files
func forexit(){
let _ = easyfile(type: mytype.dict, operation: myoperation.delete, frompath: tempdir)
let _ = easyfile(type: mytype.file, operation: myoperation.delete, frompath: "/tmp/\(bootloader.name).txt")
let _ = easyfile(type: mytype.file, operation: myoperation.delete, frompath: bootloader.path)
let _ = easyfile(type: mytype.file, operation: myoperation.delete, frompath: "tmp/allmount.txt")
exit(0)
}

//Main function
func main(){
bootloader = getboottype()
Expand Down

0 comments on commit e4ab43b

Please # to comment.