Last active
May 25, 2021 02:36
-
-
Save emadflash/fe09cbbeb9717d326ef01ce25e7ec803 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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