summaryrefslogtreecommitdiff
path: root/dotfiles/system/.zsh/modules/copy_from_zsh_src.zsh
diff options
context:
space:
mode:
Diffstat (limited to 'dotfiles/system/.zsh/modules/copy_from_zsh_src.zsh')
-rwxr-xr-xdotfiles/system/.zsh/modules/copy_from_zsh_src.zsh29
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