mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 21:14:01 +03:00
Move config path cli parameter to base
This commit is contained in:
+6
-4
@@ -12,12 +12,14 @@ import (
|
||||
)
|
||||
|
||||
type base struct {
|
||||
Network mtglib.Network
|
||||
Config *config.Config
|
||||
ConfigPath string `kong:"arg,required,type='existingfile',help='Path to the configuration file.',name='config-path'"` // nolint: lll
|
||||
|
||||
Network mtglib.Network `kong:"-"`
|
||||
Config *config.Config `kong:"-"`
|
||||
}
|
||||
|
||||
func (b *base) ReadConfig(path, version string) error {
|
||||
content, err := ioutil.ReadFile(path)
|
||||
func (b *base) ReadConfig(version string) error {
|
||||
content, err := ioutil.ReadFile(b.ConfigPath)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot read config file: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user