mirror of
https://github.com/schollz/croc.git
synced 2025-10-11 05:11:06 +02:00
simplify cleanup
This commit is contained in:
parent
cdf3aa0a31
commit
149d7364fb
2 changed files with 0 additions and 15 deletions
5
main.go
5
main.go
|
@ -11,7 +11,6 @@ import (
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
"github.com/schollz/croc/v10/src/cli"
|
"github.com/schollz/croc/v10/src/cli"
|
||||||
"github.com/schollz/croc/v10/src/utils"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
@ -46,10 +45,6 @@ func main() {
|
||||||
sig := <-sigs
|
sig := <-sigs
|
||||||
log.Println("Received signal:", sig)
|
log.Println("Received signal:", sig)
|
||||||
|
|
||||||
// Perform any necessary cleanup here
|
|
||||||
log.Println("Performing cleanup...")
|
|
||||||
utils.CleanupTempData()
|
|
||||||
|
|
||||||
// Exit the program gracefully
|
// Exit the program gracefully
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
|
|
|
@ -610,13 +610,3 @@ func ValidFileName(fname string) (err error) {
|
||||||
}
|
}
|
||||||
return
|
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")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue