}
-# sk on all the files in current git repo (except those excluded)
+# sk on all the files in current git repo
skgit() {
- local f toplevel orig_dir tmp skip pattern
- local -a ls_files excludes sk_files
+ local f toplevel orig_dir tmp
+ local -a ls_files sk_files
toplevel=$(git rev-parse --show-toplevel)
if [[ $PWD != "$toplevel" ]]; then
orig_dir=$PWD
cd $toplevel
fi
- excludes=(
- 'disabled/*'
- )
- tmp=$(git ls-files | shuf)
+ # tracked & untracked files
+ tmp=$(git ls-files && git ls-files --others --exclude-standard)
mapfile -t ls_files <<<"$tmp"
for f in "${ls_files[@]}"; do
- skip=false
- for pattern in "${excludes[@]}"; do
- if [[ $f == $pattern ]]; then
- skip=true
- break
- fi
- done
- if $skip; then continue; fi
if sk-p "$f"; then
sk_files+=("$f")
fi