Skip to content

Commit

Permalink
added skip functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirari04 committed Dec 1, 2023
1 parent 1fb5122 commit c7de47e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions console/helpers/FreshDatabase.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,26 @@
package console_helpers

import (
"bufio"
"ch/kirari04/videocms/config"
"ch/kirari04/videocms/inits"
"fmt"
"os"
)

func FreshDatabase() error {
reader := bufio.NewReader(os.Stdin)

fmt.Println("This wil delete all your files and database.")
fmt.Print("Confirm with DELETEALL: ")
msg, err := reader.ReadString('\n')
if err != nil {
return err
}
if string(msg) != "DELETEALL" {
fmt.Println("Skipping")
return nil
}
os.Remove("./database/database.sqlite")
os.RemoveAll(config.ENV.FolderVideoQualitysPriv)
os.RemoveAll(config.ENV.FolderVideoUploadsPriv)
Expand Down

0 comments on commit c7de47e

Please sign in to comment.