From ca6e7dab2012a817a1d376e708107d3ba4e51b88 Mon Sep 17 00:00:00 2001 From: Joop Kiefte Date: Thu, 28 Sep 2023 01:48:12 +0100 Subject: Correct extension bug --- main.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 881f415..af84d0d 100644 --- a/main.go +++ b/main.go @@ -142,7 +142,7 @@ func ReadTableNames() { func RunSQL(query, table string) error { // Create a temporary file to open in visidata - f, err := os.CreateTemp("", "debby-*.sql") + f, err := os.CreateTemp("", "debby-*.csv") if err != nil { return err } @@ -161,6 +161,7 @@ func RunSQL(query, table string) error { // If table is not empty, save the file to the table if table != "" { + fmt.Println("Saving to table...") err = SaveToTable(table, f.Name()) if err != nil { return err @@ -172,7 +173,7 @@ func RunSQL(query, table string) error { } func OpenVisidata(args ...string) { - vdcmd := os.Getenv("EDITOR") + vdcmd := "echo No visidata found, trying to run: vd " once.Do(func() { // run with --version and check if it returns saul.pw/VisiData, if not try the same with visidata instead for _, cmd := range []string{"vd", "visidata"} { -- cgit v1.2.3-70-g09d2