diff --git a/CHANGELOG.md b/CHANGELOG.md index a9f6784..8b81250 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [v1.6.1](https://github.com/mr-pmillz/pimp-my-shell/tree/v1.6.1) (2021-10-20) + +[Full Changelog](https://github.com/mr-pmillz/pimp-my-shell/compare/v1.6.0...v1.6.1) + +## [v1.6.0](https://github.com/mr-pmillz/pimp-my-shell/tree/v1.6.0) (2021-10-20) + +[Full Changelog](https://github.com/mr-pmillz/pimp-my-shell/compare/v1.5.9...v1.6.0) + ## [v1.5.9](https://github.com/mr-pmillz/pimp-my-shell/tree/v1.5.9) (2021-10-20) [Full Changelog](https://github.com/mr-pmillz/pimp-my-shell/compare/v1.5.8...v1.5.9) @@ -38,15 +46,15 @@ ## [v1.5.2](https://github.com/mr-pmillz/pimp-my-shell/tree/v1.5.2) (2021-10-17) -[Full Changelog](https://github.com/mr-pmillz/pimp-my-shell/compare/v1.4.5...v1.5.2) +[Full Changelog](https://github.com/mr-pmillz/pimp-my-shell/compare/v1.5.1...v1.5.2) -## [v1.4.5](https://github.com/mr-pmillz/pimp-my-shell/tree/v1.4.5) (2021-10-16) +## [v1.5.1](https://github.com/mr-pmillz/pimp-my-shell/tree/v1.5.1) (2021-10-16) -[Full Changelog](https://github.com/mr-pmillz/pimp-my-shell/compare/v1.5.1...v1.4.5) +[Full Changelog](https://github.com/mr-pmillz/pimp-my-shell/compare/v1.4.5...v1.5.1) -## [v1.5.1](https://github.com/mr-pmillz/pimp-my-shell/tree/v1.5.1) (2021-10-16) +## [v1.4.5](https://github.com/mr-pmillz/pimp-my-shell/tree/v1.4.5) (2021-10-16) -[Full Changelog](https://github.com/mr-pmillz/pimp-my-shell/compare/v1.5.0...v1.5.1) +[Full Changelog](https://github.com/mr-pmillz/pimp-my-shell/compare/v1.5.0...v1.4.5) ## [v1.5.0](https://github.com/mr-pmillz/pimp-my-shell/tree/v1.5.0) (2021-10-16) diff --git a/cheat/cheat.go b/cheat/cheat.go index 2a68ee1..f4ce71b 100644 --- a/cheat/cheat.go +++ b/cheat/cheat.go @@ -48,7 +48,7 @@ func InstallCheat(osType string, dirs *localio.Directories, packages *localio.In } if _, exists := localio.CommandExists("cheat"); !exists { fmt.Println("[+] Installing cheat") - if _, exists = localio.CommandExists("go"); !exists { + if _, exists = localio.CommandExists("go"); exists { if cheatConfigExists, err := localio.Exists("~/.config/cheat"); err == nil && !cheatConfigExists { if err := localio.RunCommandPipeOutput("go get -u github.com/cheat/cheat/cmd/cheat"); err != nil { return err diff --git a/localio/localio_test.go b/localio/localio_test.go index d49acf9..9827ebf 100644 --- a/localio/localio_test.go +++ b/localio/localio_test.go @@ -623,3 +623,19 @@ func TestRunCommands(t *testing.T) { }) } } + +func TestStartTmuxSession(t *testing.T) { + tests := []struct { + name string + wantErr bool + }{ + {name: "TestStartTmuxSession", wantErr: false}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if err := StartTmuxSession(); (err != nil) != tt.wantErr { + t.Errorf("StartTmuxSession() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} diff --git a/tmux/tmux_test.go b/tmux/tmux_test.go index 3808c4c..f35e4b4 100644 --- a/tmux/tmux_test.go +++ b/tmux/tmux_test.go @@ -57,6 +57,23 @@ func TestInstallOhMyTmux(t *testing.T) { } } +func Test_runTmux(t *testing.T) { + tests := []struct { + name string + wantErr bool + }{ + {name: "Test_runTmux 1", wantErr: true}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if err := runTmux(); (err != nil) != tt.wantErr { + t.Errorf("runTmux() error = %v, wantErr %v", err, tt.wantErr) + } + }) + } +} + + func TestStartTMUX(t *testing.T) { tests := []struct { name string diff --git a/vim/vim.go b/vim/vim.go index 3e2ea08..0696d69 100644 --- a/vim/vim.go +++ b/vim/vim.go @@ -112,7 +112,7 @@ func InstallVimPlugins(osType string, dirs *localio.Directories) error { // InstallVimAwesome ... func InstallVimAwesome(osType string, dirs *localio.Directories, packages *localio.InstalledPackages) error { - if exists, err := localio.Exists(fmt.Sprintf("%s/.vim_runtime", dirs.HomeDir)); err == nil && exists == true { + if exists, err := localio.Exists(fmt.Sprintf("%s/.vim_runtime", dirs.HomeDir)); err == nil && exists { return nil } diff --git a/vim/vim_test.go b/vim/vim_test.go index 918afa2..5a2eca4 100644 --- a/vim/vim_test.go +++ b/vim/vim_test.go @@ -1,6 +1,8 @@ package vim import ( + "fmt" + "os" "pimp-my-shell/localio" "testing" "time" @@ -59,6 +61,11 @@ func TestInstallVimAwesome(t *testing.T) { dirs *localio.Directories packages *localio.InstalledPackages } + if val, _ := os.LookupEnv("GITHUB_ACTIONS"); val == "true" { + if err = localio.RunCommandPipeOutput(fmt.Sprintf("rm -rf %s/.vim_runtime", dirs.HomeDir)); err != nil { + t.Errorf("couldn't remove ~/.vim_runtime dir. error = %v", err) + } + } tests := []struct { name string args args diff --git a/zsh/zsh_test.go b/zsh/zsh_test.go index 265ee8b..a963b94 100644 --- a/zsh/zsh_test.go +++ b/zsh/zsh_test.go @@ -2,6 +2,7 @@ package zsh import ( "fmt" + "os" "pimp-my-shell/localio" "runtime" "testing" @@ -56,6 +57,11 @@ func TestInstallOhMyZsh(t *testing.T) { } packages.AptInstalledPackages = &localio.AptInstalled{Name: []string{"bat"}} + if val, _ := os.LookupEnv("GITHUB_ACTIONS"); val == "true" { + if err = localio.RunCommandPipeOutput(fmt.Sprintf("rm -rf %s/.oh-my-zsh", dirs.HomeDir)); err != nil { + t.Errorf("couldn't remove ~/.vim_runtime dir. error = %v", err) + } + } osType := runtime.GOOS switch osType { case "linux":