Created
January 27, 2025 00:20
-
-
Save skhatri/761b9ce15b5581f84717aaf44d79a06f to your computer and use it in GitHub Desktop.
Initialise Gradle IntelliJ Bindings consistently
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 | |
dir=$(pwd) | |
rmdir(){ | |
local name=$1 | |
if [[ -d "${dir}/$name" ]]; | |
then | |
rm -rf "${dir}/$name" | |
fi; | |
} | |
rmfile(){ | |
local pattern=$1 | |
find "${dir}" -name "${pattern}" -exec rm {} \; | |
} | |
rmdir ".idea" | |
rmdir "build" | |
rmdir "out" | |
rmfile "*.iml" | |
rmfile "*.ipr" | |
rmfile "*.iws" | |
if [[ -f "${dir}/gradlew" ]]; then | |
"${dir}/gradlew" cleanIdea idea | |
elif command -v gradle &>/dev/null; then | |
gradle cleanIdea idea | |
else | |
echo "Error: gradle or gradlew not found." | |
exit 1 | |
fi | |
echo "gradle bindings generated." | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment