Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,16 @@ make docker DOCKER_IMAGE=my/docker DOCKER_TAG=0815
### evcc Core

To debug a local evcc build in VS Code, add the following entry to your `launch.json`.
You can adjust the referred configuration as needed to e.g. use your live configuration.
You can adjust the arguments as needed to e.g. use your live configuration (`-c evcc.yaml`).

```json
{
"name": "Launch evcc local build with demo config",
"name": "Launch evcc local build in demo mode",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}",
"args": ["-c", "${workspaceFolder}/cmd/demo.yaml"],
"args": ["--demo"],
"cwd": "${workspaceFolder}",
},
```
Expand Down
14 changes: 4 additions & 10 deletions cmd/demo.go
Original file line number Diff line number Diff line change
@@ -1,26 +1,20 @@
package cmd

import (
_ "embed" // for yaml
"fmt"
"strings"

"github.com/evcc-io/evcc/api/globalconfig"
)

//go:embed demo.yaml
var demoYaml string

// demoConfig replaces the config file, cmd/demo holds the configuration
func demoConfig(conf *globalconfig.All) error {
viper.SetConfigType("yaml")
if err := viper.ReadConfig(strings.NewReader(demoYaml)); err != nil {
return fmt.Errorf("failed decoding demo config: %w", err)
}

if err := viper.UnmarshalExact(conf); err != nil {
return fmt.Errorf("failed loading demo config: %w", err)
}

// never touch an existing database
conf.Database.Dsn = ":memory:"

// parse log levels after reading config
parseLogLevels()

Expand Down
313 changes: 0 additions & 313 deletions cmd/demo.yaml

This file was deleted.

Loading
Loading