diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4ffe45e..140dfde 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,4 +15,4 @@ jobs: - name: Install dependencies run: go get . - name: Test with Go CLI - run: TESTING=true go test -v ./test + run: make unit-test diff --git a/cmd/link.go b/cmd/link.go index 8fe259a..b233d78 100644 --- a/cmd/link.go +++ b/cmd/link.go @@ -53,7 +53,7 @@ func runLinkCommand(cmd *cobra.Command, args []string) { if(DryRun) { log.Printf("Will link %s -> %s\n", configPath, dotPath) } else { - if(testing == "true") { + if(testing == true) { fmt.Fprintf(cmd.OutOrStdout(), "%s,%s", configPath, dotPath) } else { err = afero.OsFs.SymlinkIfPossible(afero.OsFs{}, dotPath, configPath) diff --git a/cmd/root.go b/cmd/root.go index 0517c89..073107a 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -67,7 +67,6 @@ func init() { viper.SetConfigName("config") viper.SetConfigType("yaml") viper.AddConfigPath("./tmp/dotfiles/bender") - fmt.Printf("dotfile path is %s\n", DotfilePath) viper.AddConfigPath(filepath.Join(DotfilePath, "bender")) err := viper.ReadInConfig() diff --git a/test/link_test.go b/test/link_test.go index 723ae04..d04a5c9 100644 --- a/test/link_test.go +++ b/test/link_test.go @@ -42,7 +42,9 @@ func setUpTesting() { fs.Create(filepath.Join(homedir, ".dotfiles/bender/config")) fs.MkdirAll(filepath.Join(homedir, ".dotfiles/someconfig/"), 0755) + viper.Set("dotfile-path", filepath.Join(homedir, ".dotfiles")) viper.Set("someconfig", filepath.Join(homedir, ".config/someconfig/")) + viper.Set("testing", true) }