Skip to content

Instantly share code, notes, and snippets.

@jpcofr
Created April 6, 2023 04:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpcofr/06b2e7173ec55c04731d854e42718166 to your computer and use it in GitHub Desktop.
Save jpcofr/06b2e7173ec55c04731d854e42718166 to your computer and use it in GitHub Desktop.
Cleans make/cmake project directory
#!/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