diff options
| author | Craig Jennings <c@cjennings.net> | 2025-05-08 18:49:34 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2025-05-08 18:51:59 -0500 |
| commit | 000e00871830cd15de032c80e2b62946cf19445c (patch) | |
| tree | 794a7922750472bbe0e024042d6ba84f411fc3e0 /dotfiles/system/.zsh/modules/copy_from_zsh_src.zsh | |
| parent | fe302606931e4bad91c4ed6df81a4403523ba780 (diff) | |
adding missing dotfiles and folders
- profile.d/
- bashrc
- authinfo.gpg
- .zsh/
Diffstat (limited to 'dotfiles/system/.zsh/modules/copy_from_zsh_src.zsh')
| -rwxr-xr-x | dotfiles/system/.zsh/modules/copy_from_zsh_src.zsh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/dotfiles/system/.zsh/modules/copy_from_zsh_src.zsh b/dotfiles/system/.zsh/modules/copy_from_zsh_src.zsh new file mode 100755 index 0000000..89eee01 --- /dev/null +++ b/dotfiles/system/.zsh/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 |
