1
1
Fork 0
mirror of https://github.com/schollz/croc.git synced 2025-10-11 05:11:06 +02:00

simplify cleanup

This commit is contained in:
Zack 2024-09-03 09:16:07 -07:00
parent cdf3aa0a31
commit 149d7364fb
2 changed files with 0 additions and 15 deletions

View file

@ -11,7 +11,6 @@ import (
"syscall"
"github.com/schollz/croc/v10/src/cli"
"github.com/schollz/croc/v10/src/utils"
)
func main() {
@ -46,10 +45,6 @@ func main() {
sig := <-sigs
log.Println("Received signal:", sig)
// Perform any necessary cleanup here
log.Println("Performing cleanup...")
utils.CleanupTempData()
// Exit the program gracefully
os.Exit(0)
}

View file

@ -610,13 +610,3 @@ func ValidFileName(fname string) (err error) {
}
return
}
func CleanupTempData() {
path := "temp"
// Remove the directory and its contents
err := os.RemoveAll(path)
if err != nil {
log.Fatal(err)
} else {
log.Println("temp directory and its contents deleted successfully")
}
}