diff options
| author | Jacob McDonnell <jacob@simplelittledream.com> | 2022-07-14 19:09:06 -0400 |
|---|---|---|
| committer | Jacob McDonnell <jacob@simplelittledream.com> | 2022-07-14 19:09:06 -0400 |
| commit | ed4daf7429bf2580118aad87b8f3e2011efed7ec (patch) | |
| tree | 82f9d8ed68de119e5777f5ecfae9df4a92fe92b3 /.config/shells/zsh/plugins/fzf-tab/modules/copy_from_zsh_src.zsh | |
Initial commit
Diffstat (limited to '.config/shells/zsh/plugins/fzf-tab/modules/copy_from_zsh_src.zsh')
| -rwxr-xr-x | .config/shells/zsh/plugins/fzf-tab/modules/copy_from_zsh_src.zsh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/.config/shells/zsh/plugins/fzf-tab/modules/copy_from_zsh_src.zsh b/.config/shells/zsh/plugins/fzf-tab/modules/copy_from_zsh_src.zsh new file mode 100755 index 0000000..89eee01 --- /dev/null +++ b/.config/shells/zsh/plugins/fzf-tab/modules/copy_from_zsh_src.zsh @@ -0,0 +1,29 @@ +#!/usr/bin/env zsh + +[[ -z "$1" || "$1" = "-h" || "$1" = "--help" ]] && { print "Single argument: path to Zsh source tree"; exit 0; } + +print "Will invoke git clean -dxf, 3 seconds" +sleep 3 + +git clean -dxf + +[[ ! -d "$1" ]] && { print "Path to Zsh source doesn't exist (i.e.: $1)"; exit 1; } + +local from="$1" + +autoload -Uz colors +colors + +integer count=0 + +for i in configure.ac Src/*.c Src/*.h; do + if [[ -f "$from/$i" ]]; then + cp -vf "$from/$i" "$i" && (( ++ count )) || print "${fg_bold[red]}Copy error for: $i${reset_color}" + else + print "${fg[red]}$i Doesn't exist${reset_color}" + fi +done + +echo "${fg[green]}Copied ${fg[yellow]}$count${fg[green]} files${reset_color}" + +patch -p2 -i ./patch_cfgac.diff |
