Skip to content

Commit

Permalink
fix: default behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
vinitparekh17 committed Nov 15, 2024
1 parent 765510d commit c7ce836
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 2 additions & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
const (
DiceDBVersion string = "0.0.5"
DefaultConfigName string = "dicedb.conf"
DefaultConfigDir string = "."

EvictSimpleFirst string = "simple-first"
EvictAllKeysRandom string = "allkeys-random"
Expand Down Expand Up @@ -181,7 +182,7 @@ logging.log_level = "info"
# Authentication Configuration
auth.username = "dice"
auth.password = "vinit"
auth.password = ""
# Network Configuration
network.io_buffer_length = 512
Expand Down
6 changes: 2 additions & 4 deletions internal/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"log"
"os"
"path/filepath"
"runtime"
"strings"

Expand Down Expand Up @@ -101,10 +102,7 @@ func render() {

func Execute() {
if len(os.Args) < 2 {
parser := config.NewConfigParser()
if err := parser.ParseDefaults(config.DiceConfig); err != nil {
log.Fatal(err)
}
config.CreateConfigFile(filepath.Join(config.DefaultConfigDir, "dicedb.conf"))

render()
return
Expand Down

0 comments on commit c7ce836

Please sign in to comment.