replaced archived survey dep with osutils.YesNoPrompt helper

This commit is contained in:
Gani Georgiev
2025-01-21 21:03:35 +02:00
parent a4a228b368
commit 91d4ca5c06
8 changed files with 112 additions and 63 deletions
+2 -6
View File
@@ -23,9 +23,9 @@ import (
"path/filepath"
"time"
"github.com/AlecAivazis/survey/v2"
"github.com/pocketbase/pocketbase/core"
"github.com/pocketbase/pocketbase/tools/inflector"
"github.com/pocketbase/pocketbase/tools/osutils"
"github.com/spf13/cobra"
)
@@ -156,11 +156,7 @@ func (p *plugin) migrateCreateHandler(template string, args []string, interactiv
resultFilePath := path.Join(dir, filename)
if interactive {
confirm := false
prompt := &survey.Confirm{
Message: fmt.Sprintf("Do you really want to create migration %q?", resultFilePath),
}
survey.AskOne(prompt, &confirm)
confirm := osutils.YesNoPrompt(fmt.Sprintf("Do you really want to create migration %q?", resultFilePath), false)
if !confirm {
fmt.Println("The command has been cancelled")
return "", nil