diff --git a/vimfiles/tools/shell/bash/update-filelist.sh b/vimfiles/tools/shell/bash/update-filelist.sh index 9d974336..0aa13fac 100644 --- a/vimfiles/tools/shell/bash/update-filelist.sh +++ b/vimfiles/tools/shell/bash/update-filelist.sh @@ -27,7 +27,7 @@ else find ${FORCE_POSIX_REGEX_1} . -type f -not -path "*/\.*" ${FORCE_POSIX_REGEX_2} -regex ".*\.("${FILE_SUFFIXS}")$" > "${TMP}" if [[ "${FILE_SUFFIXS}" =~ __EMPTY__ ]]; then - find ${FORCE_POSIX_REGEX_1} . -type f -not -path "*/\.*" ${FORCE_POSIX_REGEX_2} -regex ".*\.("${FILE_SUFFIXS}")$" |grep -v "\.\w*$" |xargs -i sh -c 'file="{}";type=$(file $file);[[ $type =~ "text" ]] && echo $file' >> "${TMP}" + find ${FORCE_POSIX_REGEX_1} . -type f -not -path "*/\.*" |grep -v "\.\w*$" |xargs -i sh -c 'file="{}";type=$(file $file);[[ $type =~ "text" ]] && echo $file' >> "${TMP}" fi fi diff --git a/vimfiles/tools/shell/batch/update-filelist.bat b/vimfiles/tools/shell/batch/update-filelist.bat index defa4998..e9543942 100644 --- a/vimfiles/tools/shell/batch/update-filelist.bat +++ b/vimfiles/tools/shell/batch/update-filelist.bat @@ -21,6 +21,9 @@ for /f "delims=" %%a in ('echo %cd%^|%SED_CMD% "s,\\,\\\\,g"') do ( rem process echo ^|- generate %TMP% dir /s /b %FILE_SUFFIXS%|%SED_CMD% "s,\(%CWD_PATTERN%\)\(.*\),.\2,gI" > "%TMP%" +dir /s /b |grep -v "\.\w*$" |%SED_CMD% "s,\(%CWD_PATTERN%\)\(.*\),.\2,gI" > "%TMP2%" +file -f "%TMP2%" |grep "ASCII.*text"|%SED_CMD% "s/;.*$//g" >> "%TMP%" +del "%TMP2%" > nul echo ^|- apply filter rem NOTE: dir /s /b *.cpp will list xxx.cpp~, too. So use gawk here to filter out thoes things.