Keep extras on upgrade in macos

This commit is contained in:
twangboy 2023-08-28 17:27:34 -06:00 committed by Megan Wilhite
parent 678831fa65
commit fb0e7a9d42

View file

@ -96,12 +96,20 @@ if [ -L "$SBIN_DIR/salt-config" ]; then
fi
#-------------------------------------------------------------------------------
# Remove the $INSTALL_DIR directory
# Remove folders and files from the INSTALL_DIR
# Don't remove extras-3.10
#-------------------------------------------------------------------------------
if [ -d "$INSTALL_DIR" ]; then
log "Cleanup: Removing $INSTALL_DIR"
rm -rf "$INSTALL_DIR"
log "Cleanup: Removed Successfully"
for dir in "$INSTALL_DIR"/*/; do
if [[ "$dir" != *"extras-3."* ]]; then
log "Cleanup: Removing $dir"
rm -rf "$dir"
fi
done
log "Cleanup: Removed Directories Successfully"
if [ -f "$INSTALL_DIR/salt-minion" ]; then
find $INSTALL_DIR -maxdepth 1 -type f -delete
log "Cleanup: Removed Files Successfully"
fi
#-------------------------------------------------------------------------------