Created
April 6, 2023 04:55
-
-
Save jpcofr/06b2e7173ec55c04731d854e42718166 to your computer and use it in GitHub Desktop.
Cleans make/cmake project directory
This file contains 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
#!/bin/bash | |
# This script cleans the project directory. | |
# The CLIs are compatible with Linux and Mac OS X. | |
## Function: clean_project | |
function clean_project() { | |
# Delete CMake generated files except CMakeLists.txt | |
find . -iwholename '*cmake*' -not -name CMakeLists.txt -delete | |
# Delete makefile | |
find . -iwholename '*makefile*' -delete | |
# Delete every executable file except this files | |
find . -type f -not -path './clean_prj' -perm +a=x -delete | |
} | |
clean_project "$1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment