Skip to content

Instantly share code, notes, and snippets.

@emadflash
Last active May 25, 2021 02:36
Show Gist options
  • Save emadflash/fe09cbbeb9717d326ef01ce25e7ec803 to your computer and use it in GitHub Desktop.
Save emadflash/fe09cbbeb9717d326ef01ce25e7ec803 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -e
set -u
set -o pipefail
declare -a exclude_dirs
exclude_dirs=(
"build"
"dist"
"test"
"asset"
)
make_exlude_dir_string() {
local s=""
for dir in "${exclude_dirs[@]}"; do
s+=".*/$dir/|"
done
echo "${s::-1}"
}
exclude_dir_string="$(make_exlude_dir_string)"
find . -type f -iname \*.*js | egrep -v "($exclude_dir_string)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment