Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelmota committed Dec 31, 2018
1 parent 22d551b commit b91ef29
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,12 @@ defaultView = "default"
v = "sort_column_24h_volume"
```

You may specify a different config file to use by using the `-config` flag:

```bash
cointop -config="/path/to/config"
```

## List of actions

This are the action keywords you may use in the config file to change what the shortcut keys do.
Expand Down
7 changes: 4 additions & 3 deletions cointop/cointop.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,16 @@ type Config struct {
ConfigFilepath string
}

var defaultConfigPath = "~/.cointop/config"

// NewCointop initializes cointop
func NewCointop(config *Config) *Cointop {
var debug bool
if os.Getenv("DEBUG") != "" {
debug = true
}

configFilepath := "~/.cointop/config"
configFilepath := defaultConfigPath
if config != nil {
if config.ConfigFilepath != "" {
configFilepath = config.ConfigFilepath
Expand Down Expand Up @@ -275,9 +277,8 @@ func Clean() {
func Reset() {
Clean()

homedir := userHomeDir()
// default config path
configPath := fmt.Sprintf("%s%s", homedir, "/.cointop")
configPath := fmt.Sprintf("%s%s", userHomeDir(), "/.cointop")
if _, err := os.Stat(configPath); !os.IsNotExist(err) {
fmt.Printf("removing %s\n", configPath)
if err := os.RemoveAll(configPath); err != nil {
Expand Down

0 comments on commit b91ef29

Please sign in to comment.