aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2016-05-05 13:45:00 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2016-05-05 13:45:00 +0300
commitce011543cc35e38ca14fa1c0595490b8413175e7 (patch)
tree3775abb1df3d63c5610eb2131512be083c491568
parentREADME update (diff)
downloadlinux-home-ce011543cc35e38ca14fa1c0595490b8413175e7.tar.gz
linux-home-ce011543cc35e38ca14fa1c0595490b8413175e7.zip
add sanitize_dos_files_in_dir
Diffstat (limited to '')
-rw-r--r--.bashrc32
1 files changed, 32 insertions, 0 deletions
diff --git a/.bashrc b/.bashrc
index 0e2cea8..d469dfa 100644
--- a/.bashrc
+++ b/.bashrc
@@ -241,6 +241,38 @@ sanitize_unix_files() {
&& ensure_ends_with_unix_newline "$@"
}
+sanitize_dos_files_in_dir() {
+ if [ "$#" -lt 1 ]; then
+ echo "Usage: $FUNCNAME DIRNAME [FILENAME_MASK...]" >&2
+ return 1
+ fi
+ local cmd="$( printf 'find %q -type f' "$1" )"
+ if [ "$#" -gt 1 ]; then
+ cmd+="$( printf ' %q' '-(' )"
+ shift
+ cmd+="$( printf ' -name %q' "$1" )"
+ shift
+ local fn_mask
+ for fn_mask; do
+ cmd+="$( printf ' -o -name %q' "$fn_mask" )"
+ done
+ cmd+="$( printf ' %q' '-)' )"
+ fi
+ cmd+=' -print0'
+ local path
+ eval "$cmd" | while read -d '' -r path; do
+ sanitize_dos_files "$path"
+ done || return $?
+}
+
+sanitize_dos_files_in_dir_nwx() {
+ local root_dirname='/cygdrive/c/Netwrix Auditor/CurrentVersion-AuditCore-Dev/AuditCore/Sources'
+ sanitize_dos_files_in_dir \
+ "$root_dirname/Configuration" WebAPI*.acinc WebAPI*.acconf || return $?
+ sanitize_dos_files_in_dir \
+ "$root_dirname/Subsystems/PublicAPI" *.cpp *.h || return $?
+}
+
backup_repo() {
for repo_path; do
local zipname="$( basename "$( realpath "$repo_path" )" )_$( date -u +'%Y%m%dT%H%M%S' ).zip"