Make auto cleanup fast and clean
Changes: - Suppress trace eraser output in auto mode (only show ✓) - Clear screen after cleanup - Leave user in /root directory - Single success message Result: - Question -> yes -> quick cleanup -> ✓ All traces removed -> /root - Fast, minimal output, clean exit
This commit is contained in:
+2
-2
@@ -1507,8 +1507,8 @@ main() {
|
|||||||
read -p "Clean history and remove traces? (yes/no): " clean_hist
|
read -p "Clean history and remove traces? (yes/no): " clean_hist
|
||||||
|
|
||||||
if [ "$clean_hist" = "yes" ]; then
|
if [ "$clean_hist" = "yes" ]; then
|
||||||
# Run trace eraser in non-interactive mode
|
# Run trace eraser in non-interactive mode (suppress output)
|
||||||
TRACE_ERASER_AUTO=yes bash "$BASE_DIR/tools/erase-toolkit-traces.sh"
|
TRACE_ERASER_AUTO=yes bash "$BASE_DIR/tools/erase-toolkit-traces.sh" 2>&1 | grep -E "^✓|^$" || true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
|
|||||||
@@ -31,9 +31,12 @@ if [ "$TRACE_ERASER_AUTO" != "yes" ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo ""
|
# Only show progress if not in auto mode
|
||||||
echo "Removing traces..."
|
if [ "$TRACE_ERASER_AUTO" != "yes" ]; then
|
||||||
echo ""
|
echo ""
|
||||||
|
echo "Removing traces..."
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
|
||||||
# Patterns to remove from history
|
# Patterns to remove from history
|
||||||
PATTERNS=(
|
PATTERNS=(
|
||||||
@@ -159,13 +162,11 @@ fi
|
|||||||
|
|
||||||
# Offer to remove the entire toolkit (AFTER history cleaning)
|
# Offer to remove the entire toolkit (AFTER history cleaning)
|
||||||
if [ "$TRACE_ERASER_AUTO" = "yes" ]; then
|
if [ "$TRACE_ERASER_AUTO" = "yes" ]; then
|
||||||
# Auto mode: always remove directory and skip prompt
|
# Auto mode: quick cleanup, minimal output
|
||||||
echo ""
|
cd /root 2>/dev/null
|
||||||
echo "Removing toolkit directory..."
|
rm -rf "$SCRIPT_DIR" 2>/dev/null
|
||||||
cd /root
|
clear
|
||||||
rm -rf "$SCRIPT_DIR"
|
echo -e "${GREEN}✓ All traces removed${NC}"
|
||||||
echo ""
|
|
||||||
echo -e "${GREEN}✓ Toolkit completely removed${NC}"
|
|
||||||
else
|
else
|
||||||
# Manual mode: ask user
|
# Manual mode: ask user
|
||||||
echo ""
|
echo ""
|
||||||
@@ -190,9 +191,9 @@ else
|
|||||||
echo "Toolkit directory remains at: $SCRIPT_DIR"
|
echo "Toolkit directory remains at: $SCRIPT_DIR"
|
||||||
echo "You can manually remove it later with: rm -rf $SCRIPT_DIR"
|
echo "You can manually remove it later with: rm -rf $SCRIPT_DIR"
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "All traces removed. The trace eraser commands will also be"
|
echo "All traces removed. The trace eraser commands will also be"
|
||||||
echo "removed when you log out or start a new shell session."
|
echo "removed when you log out or start a new shell session."
|
||||||
echo ""
|
echo ""
|
||||||
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user