feat: remove path flags

main
Tran Hau 2021-01-18 16:06:36 +07:00
parent 48600a5f7a
commit 8b0301757b
1 changed files with 0 additions and 16 deletions

16
main.go
View File

@ -11,8 +11,6 @@ import (
const (
appName = "dotfiles"
pathFlag = "path"
installCommand = "install"
updateCommand = "update"
)
@ -37,12 +35,6 @@ func main() {
Action: a.RunUpdate,
},
},
Flags: []cli.Flag{
&cli.StringFlag{
Name: pathFlag,
Usage: "path to `DOTFILES`",
},
},
Action: a.Run,
}
@ -66,8 +58,6 @@ func (a *action) Run(c *cli.Context) error {
}
func (a *action) RunInstall(c *cli.Context) error {
a.getFlags(c)
cfg, err := LoadConfig(a.flags.path)
if err != nil {
return fmt.Errorf("failed to load config: %w", err)
@ -81,8 +71,6 @@ func (a *action) RunInstall(c *cli.Context) error {
}
func (a *action) RunUpdate(c *cli.Context) error {
a.getFlags(c)
cfg, err := LoadConfig(a.flags.path)
if err != nil {
return fmt.Errorf("failed to load config: %w", err)
@ -94,7 +82,3 @@ func (a *action) RunUpdate(c *cli.Context) error {
return nil
}
func (a *action) getFlags(c *cli.Context) {
a.flags.path = c.String(pathFlag)
}