Skip to content

Commit cac4995

Browse files
authored
Fix 'turso db import' with no arguments panicing (#953)
2 parents bbf91ca + be0ed71 commit cac4995

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

internal/cmd/db_import.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package cmd
22

33
import (
4+
"fmt"
45
"path/filepath"
56
"strings"
67

@@ -22,6 +23,9 @@ var importCmd = &cobra.Command{
2223
},
2324
RunE: func(cmd *cobra.Command, args []string) error {
2425
cmd.SilenceUsage = true
26+
if len(args) == 0 {
27+
return fmt.Errorf("filename is required: 'turso db import <filename>'")
28+
}
2529
filename := args[0]
2630
fromFileFlag = filename
2731
name := sanitizeDatabaseName(filename)

0 commit comments

Comments
 (0)