1
0
mirror of https://github.com/jordansissel/fpm synced 2025-02-23 01:51:16 +01:00
fpm/templates/pleaserun/generate-cleanup.sh
Jordan Sissel 0a2badb1c8 Refactor. Also now we attempt cleanup upon package removal.
The `install.sh` will generate a cleanup.sh script that is executed when
the package is removed.
2016-05-15 04:09:19 -07:00

18 lines
261 B
Bash

#!/bin/sh
show_cleanup_step() {
d="${1##.}"
if [ ! -z "$d" ] ; then
if [ -d "$1" -a ! -d "$d" ] ; then
echo "rmdir \"$d\""
fi
if [ -f "$1" ] ; then
echo "rm \"$d\""
fi
fi
}
for i in "$@" ; do
show_cleanup_step "$i"
done