clean func

This commit is contained in:
timerix 2023-04-01 15:55:17 +06:00
parent 2bebe76c7e
commit e83a7affef
3 changed files with 11 additions and 2 deletions

View File

@ -4,6 +4,7 @@
+ default C++ standard set to `c++11`
+ added `INCLUDE` to `default.config`
+ moved `LINKER_ARGS` to the end of linkage command in `functions.sh` to properly link static libs
+ added function `try_delete_dir_or_file` for `clean` task
# v5
+ added task `clean`

View File

@ -1,6 +1,6 @@
#!/usr/bin/bash
delete_dir "$OBJDIR"
delete_dir "$OUTDIR"
try_delete_dir_or_file "$OBJDIR"
try_delete_dir_or_file "$OUTDIR"
myprint "${WHITE}deleting build logs"
rm -rf *.log

View File

@ -22,6 +22,14 @@ function delete_dir {
rm -rf "$dir"
}
function try_delete_dir_or_file {
local path="$1"
if [ -f "$path" ] || [ -d "$path" ]; then
rm -rf "$path"
myprint "${WHITE}deleting $path"
fi
}
function compile {
local cmp="$1"