summaryrefslogtreecommitdiff
path: root/script/delete_file.sh
blob: ebcc5b0a9d94c56677b2ee9cabea965f99434441 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
delete_file() {
    path="$1"

    if [ "$DELETE_OBSOLETE" = 'YES' ]; then
        if [ -e "$path" -o -e "$path.old" ]; then
            echo '==='
            if [ -e "$path"     ]; then echo "rm -f \"$path\"";     fi
            if [ -e "$path.old" ]; then echo "rm -f \"$path.old\""; fi
            if [ "$DRY" != 'YES' ]; then
                rm -f "$path" "$path.old"
	    fi
        fi
    fi
}