[windows] Use native walker since output of DOS command is not UTF-8 encoded (#1847)

Makes scanning 300x faster on Windows
This commit is contained in:
mattn
2020-02-04 12:31:00 +09:00
committed by GitHub
parent f5cf4fc8fb
commit 311b78ae82
4 changed files with 87 additions and 43 deletions

View File

@@ -62,8 +62,6 @@ func init() {
defaultCommand = `set -o pipefail; command find -L . -mindepth 1 \( -path '*/\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \) -prune -o -type f -print -o -type l -print 2> /dev/null | cut -b3-`
} else if os.Getenv("TERM") == "cygwin" {
defaultCommand = `sh -c "command find -L . -mindepth 1 -path '*/\.*' -prune -o -type f -print -o -type l -print 2> /dev/null | cut -b3-"`
} else {
defaultCommand = `for /r %P in (*) do @(set "_curfile=%P" & set "_curfile=!_curfile:%__CD__%=!" & echo !_curfile!)`
}
}