Skip to content

Commit

Permalink
⚡ Minor UX updates
Browse files Browse the repository at this point in the history
  • Loading branch information
beskay committed Sep 2, 2023
1 parent 7ef157e commit 7daf981
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ You can then validate your solution with 'evmr validate' or by using the forge t
fmt.Printf("No template file selected.\n\n")
}

fmt.Printf("You can start working on level '%s/' in:\n%s\n\nTo validate your solution, run 'evmr validate %s'\n", level, filepath.Join(config.EVMR_LEVELS_DIR, "src"), level)
fmt.Printf("You can start working on level '%s' in:\n%s\n\nTo validate your solution, run 'evmr validate %s'\n", level, filepath.Join(config.EVMR_LEVELS_DIR, "src"), level)

return nil
},
Expand Down
4 changes: 2 additions & 2 deletions internal/tui/leaderboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ func leaderboardTable(submissions []utils.SubmissionData, field string) string {

var headlineText string
if field == "gas" {
headlineText = "GAS STATISTICS"
headlineText = "GAS LEADERBOARD"
} else if field == "size" {
headlineText = "SIZE STATISTICS"
headlineText = "SIZE LEADERBOARD"
}

headline := "\x1b[1m" + headlineText + "\x1b[0m" + "\n\n"
Expand Down
11 changes: 9 additions & 2 deletions internal/utils/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func LoadConfig() (Config, error) {
// Check if the config file exists before trying to read it
if _, err := os.Stat(envFilePath); os.IsNotExist(err) {
// print error to run evm-runners init first
return config, fmt.Errorf("No config file found. Please run 'evm-runners init' first!\n")
return config, fmt.Errorf("No config file found. Please run 'evmr init' first!\n")
}

// Read the config file
Expand Down Expand Up @@ -99,7 +99,14 @@ func LoadLevels() (map[string]Level, error) {

}

viper.SetConfigFile(filepath.Join(config.EVMR_LEVELS_DIR, levelsFile))
levelsFilePath := filepath.Join(config.EVMR_LEVELS_DIR, levelsFile)
viper.SetConfigFile(levelsFilePath)

// Check if the config file exists before trying to read it
if _, err := os.Stat(levelsFilePath); os.IsNotExist(err) {
// print error to run evm-runners init first
return nil, fmt.Errorf("No config file found. Please run 'evmr init' first!\n")
}

// Read the config file
if err := viper.ReadInConfig(); err != nil {
Expand Down

0 comments on commit 7daf981

Please sign in to comment.