Created
June 4, 2020 14:52
-
-
Save kerasai/588b35cf596f5415d1827c1135cfd4ad to your computer and use it in GitHub Desktop.
Clean Git type files from dependencies, when they've got to be committed (barf)
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 | |
DEPENDENCY_LOCATIONS=("./drush/Commands/contrib") | |
DEPENDENCY_LOCATIONS+=("./vendor") | |
DEPENDENCY_LOCATIONS+=("./web/libraries") | |
DEPENDENCY_LOCATIONS+=("./web/modules/contrib") | |
DEPENDENCY_LOCATIONS+=("./web/profiles/contrib") | |
DEPENDENCY_LOCATIONS+=("./web/themes/contrib") | |
for DEPENDENCY_LOCATION in "${DEPENDENCY_LOCATIONS[@]}" | |
do | |
if [[ -d $DEPENDENCY_LOCATION ]] | |
then | |
echo "Removing git repository files from dependencies in ${DEPENDENCY_LOCATION}." | |
find ${DEPENDENCY_LOCATION} -name .git | xargs rm -rf | |
find ${DEPENDENCY_LOCATION} -name .gitignore | xargs rm -rf | |
else | |
echo "The file ${DEPENDENCY_LOCATION} does not exist." | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment