diff --git a/internal/cli/app.go b/internal/cli/app.go index 6530863..b70c77e 100644 --- a/internal/cli/app.go +++ b/internal/cli/app.go @@ -25,7 +25,7 @@ func (app *appEnv) noOp() bool { func alternativeNewAppEnv(cmd string) *appEnv { return &appEnv{ cmd: cmd, - exitValue: exitSucess, + exitValue: exitSuccess, } } diff --git a/internal/cli/getrepos_test.go b/internal/cli/getrepos_test.go index 0fddb49..2c6347b 100644 --- a/internal/cli/getrepos_test.go +++ b/internal/cli/getrepos_test.go @@ -14,20 +14,18 @@ func makeRepos() []Repo { } } -func makeNewAppEnv(cfgFile string) *appEnv { - cfg := &cfg{ - cmd: "test", - subCmd: "testing", - cfgFile: cfgFile, - defaultCfgFile: false, +func fakeNewAppEnv(cfgFile string) *appEnv { + return &appEnv{ + cmd: "test", + subCmd: "testing", + cfgFile: cfgFile, + exitValue: exitSuccess, } - - return newAppEnv(cfg) } func TestGetReposSuccess(t *testing.T) { expected := makeRepos() - app := makeNewAppEnv("testdata/backups.json") + app := fakeNewAppEnv("testdata/backups.json") actual := app.getRepos() if app.exitValue != exitSuccess { @@ -40,7 +38,7 @@ func TestGetReposSuccess(t *testing.T) { } func TestGetReposFailure(t *testing.T) { - app := makeNewAppEnv("testdata/nope.json") + app := fakeNewAppEnv("testdata/nope.json") app.getRepos() if app.exitValue != exitFailure { @@ -49,7 +47,7 @@ func TestGetReposFailure(t *testing.T) { } func TestRepoChecks(t *testing.T) { - app := makeNewAppEnv("testdata/repo-checks.json") + app := fakeNewAppEnv("testdata/repo-checks.json") actual := app.getRepos() if len(actual) != 0 { diff --git a/internal/cli/gitmirror.go b/internal/cli/gitmirror.go index 8ee942e..2441d34 100644 --- a/internal/cli/gitmirror.go +++ b/internal/cli/gitmirror.go @@ -75,11 +75,10 @@ func parse(args []string) (*cfg, error) { app.subCmd = op.Extra[0] // TODO: Fix this if app.cfgFile == "" { - app.defaultCfgFile = true - cfg.cfgFile = defaultCfgFile + app.cfgFile = defaultCfgFile } - return cfg, nil + return nil, nil } // Quick and dirty, but why be fancy?