Wire most of the work from today together

This commit is contained in:
AlexSSD7 2023-08-31 16:23:40 +01:00
commit e57519e58d
12 changed files with 328 additions and 132 deletions

View file

@ -7,6 +7,7 @@ import (
"os"
"strings"
"github.com/AlexSSD7/linsk/utils"
"github.com/spf13/cobra"
)
@ -26,7 +27,7 @@ var cleanCmd = &cobra.Command{
os.Exit(1)
}
if strings.ToLower(string(answer)) != "y\n" {
if utils.ClearUnprintableChars(strings.ToLower(string(answer)), false) != "y" {
fmt.Fprintf(os.Stderr, "Aborted.\n")
os.Exit(2)
}
@ -37,6 +38,8 @@ var cleanCmd = &cobra.Command{
os.Exit(1)
}
// TODO: Clean network tap allocations, if any.
slog.Info("Deleted data directory", "path", rmPath)
},
}