checked if logs ID is empty

This commit is contained in:
Darko Luketic 2023-12-02 00:04:04 +01:00
parent 46615e32ec
commit 0b1f545aa5
1 changed files with 4 additions and 0 deletions

View File

@ -2,6 +2,7 @@ package cmd
import (
"context"
"errors"
"fmt"
"runtime"
@ -24,6 +25,9 @@ var logsCmd = &cobra.Command{
Short: "Show logs of a project",
RunE: func(cmd *cobra.Command, args []string) error {
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))
if err != nil {
return fmt.Errorf("failed opening connection to sqlite: %v", err)