I want to add directories to a variable as such:
WATCHED_DIR="\
someDir_1/* \
someDir_2/* \
someDir_3/* \
Each directory has a lot of sub directories and most of the time its ok. But now I want to make a variable with a list of sub directories I want to exclude
Such as:
EXCLUDED_DIRS:"\
someDir_2/docs/ \
someDir_3/docs/ "
I am unsure how to do the exclusion part.
Update: To clarify what I am trying to accomplish might be better understood with the code snippet below
# Add directories to watch
WATCH_FILES="\
.github/workflows/ci-tests/Examples_tests \
Examples/MCU1/BLE \
Examples/MCU1/Bootloader \
Libraries/libs.mk \
Libraries/Cordio/* \
Libraries/CMSIS/Device/MCU1 \
Libraries/PeriphDrivers/ \\
Libraries/BlePhy/ \
Libraries/Boards/"
#remove unwanted sub-directories
IGNORED_DIRS="\
Libraries/Cordio/docs \
Libraries/Cordio/controller"
for ignored_dir in $IGNORED_DIRS; do
# some how remove from watch files
done
When I print out WATCH_FILES I get all the sub-directories inside of Cordio which I think is good because I can go delete it. If I remove the * from Cordio I do not get the sub directories in my string. The desired end result is to end up with WATCH_FILES that does not have the ignored sub directories.
With the clean list of WATCH Files I then do a git diff and see if any of the changed files live in this WATCH Files directories
findcommand?