checked if logs ID is empty
This commit is contained in:
parent
46615e32ec
commit
0b1f545aa5
@ -2,6 +2,7 @@ package cmd
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
|
||||||
@ -24,6 +25,9 @@ var logsCmd = &cobra.Command{
|
|||||||
Short: "Show logs of a project",
|
Short: "Show logs of a project",
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
runtime.GOMAXPROCS(1)
|
runtime.GOMAXPROCS(1)
|
||||||
|
if showLogID == -1 {
|
||||||
|
return errors.New("ID can not be empty")
|
||||||
|
}
|
||||||
client, err := ent.Open("sqlite3", fmt.Sprintf("file:%s?mode=rwc&cache=private&_fk=1", sqliteFilename))
|
client, err := ent.Open("sqlite3", fmt.Sprintf("file:%s?mode=rwc&cache=private&_fk=1", sqliteFilename))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed opening connection to sqlite: %v", err)
|
return fmt.Errorf("failed opening connection to sqlite: %v", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user