diff --git a/CHANGELOG.md b/CHANGELOG.md index d2c3b9f..b1d5ece 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## [v1.6.4](https://github.com/mr-pmillz/pimp-my-shell/tree/v1.6.4) (2021-10-22) + +[Full Changelog](https://github.com/mr-pmillz/pimp-my-shell/compare/v1.6.3...v1.6.4) + ## [v1.6.3](https://github.com/mr-pmillz/pimp-my-shell/tree/v1.6.3) (2021-10-20) [Full Changelog](https://github.com/mr-pmillz/pimp-my-shell/compare/v1.6.2...v1.6.3) @@ -54,15 +58,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/README.md b/README.md index 1da6e77..c90e56f 100644 --- a/README.md +++ b/README.md @@ -55,10 +55,11 @@ After Installation, if you want to Customize Powerlevel10k zsh theme differently p10k configure ``` -Make sure your vim binaries installed. They should be from ./pimp-my-shell but just in case run the command below. +If you want your custom vim plugins to automatically update, simply create this cronjob ```shell -vim +GoInstallBinaries +crontab -e +0 12 * * * cd ~/.vim_runtime/my_plugins && ./update.sh > gitPullUpdates.txt 2>&1 ``` ## About diff --git a/extra/extra_test.go b/extra/extra_test.go index d70eed6..e817ac2 100644 --- a/extra/extra_test.go +++ b/extra/extra_test.go @@ -63,6 +63,20 @@ func TestInstallExtraPackages(t *testing.T) { AptInstalledPackages: &localio.AptInstalled{Name: []string{"lsd"}}, BrewInstalledPackages: nil, }}, false}, + {"Test InstallExtraPackages Linux 4 Should Fail", args{ + osType: "linux", + dirs: dirs, + packages: &localio.InstalledPackages{ + AptInstalledPackages: nil, + BrewInstalledPackages: nil, + }}, true}, + {"Test InstallExtraPackages Darwin 5 Should Fail", args{ + osType: "darwin", + dirs: dirs, + packages: &localio.InstalledPackages{ + AptInstalledPackages: nil, + BrewInstalledPackages: nil, + }}, true}, } timeout := time.After(20 * time.Minute) done := make(chan bool) diff --git a/macosx/macosx_test.go b/macosx/macosx_test.go index 2d7fd92..13c1a89 100644 --- a/macosx/macosx_test.go +++ b/macosx/macosx_test.go @@ -10,6 +10,11 @@ func TestInstallHomebrew(t *testing.T) { if err != nil { t.Errorf("failed to create Directories type: %v", err) } + fakeDirs, err := localio.NewDirectories() + if err != nil { + t.Errorf("failed to create Directories type: %v", err) + } + fakeDirs.HomeDir = "/asdfasdf/sadfasdf/asdfsadf" type args struct { dirs *localio.Directories } @@ -19,6 +24,7 @@ func TestInstallHomebrew(t *testing.T) { wantErr bool }{ {"Test InstallHomebrew 1", args{dirs: dirs}, false}, + {"Test InstallHomebrew 2 Should Fail", args{dirs: fakeDirs}, true}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/tmux/tmux_test.go b/tmux/tmux_test.go index 85b9697..3497770 100644 --- a/tmux/tmux_test.go +++ b/tmux/tmux_test.go @@ -47,6 +47,20 @@ func TestInstallOhMyTmux(t *testing.T) { AptInstalledPackages: &localio.AptInstalled{Name: []string{"xclip", "tmux"}}, BrewInstalledPackages: nil, }}, false}, + {"Test InstallOhMyTmux darwin 3 Should Fail", args{ + osType: "darwin", + dirs: dirs, + packages: &localio.InstalledPackages{ + AptInstalledPackages: nil, + BrewInstalledPackages: nil, + }}, true}, + {"Test InstallOhMyTmux Linux 4 Should fail", args{ + osType: "linux", + dirs: dirs, + packages: &localio.InstalledPackages{ + AptInstalledPackages: nil, + BrewInstalledPackages: nil, + }}, true}, } timeout := time.After(20 * time.Minute) done := make(chan bool) diff --git a/vim/templates/update.sh b/vim/templates/update.sh new file mode 100644 index 0000000..218a2c8 --- /dev/null +++ b/vim/templates/update.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# store the current dir +CUR_DIR=$(pwd) +date +# Let the person running the script know what's going on. +echo -e "\n\033[1mPulling in latest changes for all repositories...\033[0m\n" + +# Find all git repositories and update it to the master latest revision +for i in $(find . -name ".git" | cut -c 3-); do + echo ""; + echo -e "\033[33m"+$i+"\033[0m"; + cd "$i"; # We have to go to the .git parent directory to call the pull command + cd ..; + git pull; # finally pull + cd $CUR_DIR # lets get back to the CUR_DIR +done +echo -e "\n\033[32mComplete!\033[0m\n" diff --git a/vim/vim.go b/vim/vim.go index 4214d61..dd26fb0 100644 --- a/vim/vim.go +++ b/vim/vim.go @@ -92,12 +92,23 @@ func InstallVimPlugins(osType string, dirs *localio.Directories) error { return err } + updateVimCustomPlugins, err := myConfigs.Open("templates/update.sh") + if err != nil { + return err + } + if err = localio.EmbedFileCopy("~/.vim_runtime/my_configs.vim", myConfigFS); err != nil { return err } if err = localio.EmbedFileCopy("~/.vimrc", vimrcFS); err != nil { return err } + // Useful bash script to update plugins + // set it on a cron + // 0 12 * * * cd ~/.vim_runtime/my_plugins && ./update.sh > gitPullUpdates.txt 2>&1 + if err = localio.EmbedFileCopy("~/.vim_runtime/my_plugins/update.sh", updateVimCustomPlugins); err != nil { + return err + } fmt.Println("[+] Installing vim binaries via +GoInstallBinaries") if err = localio.RunCommandPipeOutput("vim +GoInstallBinaries +qa || true"); err != nil { diff --git a/vim/vim_test.go b/vim/vim_test.go index 5a2eca4..ba0fa2b 100644 --- a/vim/vim_test.go +++ b/vim/vim_test.go @@ -87,6 +87,20 @@ func TestInstallVimAwesome(t *testing.T) { AptInstalledPackages: &localio.AptInstalled{Name: []string{"bat", "lsd", "gotop", "delta"}}, BrewInstalledPackages: nil, }}, false}, + {"Test InstallOhMyTmux Linux 3", args{ + osType: "linux", + dirs: dirs, + packages: &localio.InstalledPackages{ + AptInstalledPackages: nil, + BrewInstalledPackages: nil, + }}, true}, + {"Test InstallOhMyTmux Darwin 4", args{ + osType: "darwin", + dirs: dirs, + packages: &localio.InstalledPackages{ + AptInstalledPackages: nil, + BrewInstalledPackages: nil, + }}, true}, } timeout := time.After(20 * time.Minute) done := make(chan bool)