1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-04 12:41:46 +00:00

Use more robust scripts

This commit is contained in:
Tw93
2025-11-19 09:45:14 +08:00
parent 0154c272fb
commit f8f9d7db7d
7 changed files with 57 additions and 20 deletions

View File

@@ -52,10 +52,10 @@ fi
# 3. Unit tests (if available)
echo -e "${YELLOW}3. Running tests...${NC}"
if command -v bats > /dev/null 2>&1 && [ -d "tests" ]; then
if bats tests/*.bats 2> /dev/null; then
if bats tests/*.bats; then
echo -e "${GREEN}✓ Tests passed${NC}\n"
else
echo -e "${RED}✗ Tests failed${NC}\n"
echo -e "${RED}✗ Tests failed (see output above)${NC}\n"
exit 1
fi
else
@@ -88,7 +88,7 @@ fi
# Check 3: Log rotation once per session
((TOTAL_CHECKS++))
if grep -q "rotate_log_once" lib/common.sh && ! grep -q "rotate_log()" lib/common.sh | grep -v "rotate_log_once"; then
if grep -q "rotate_log_once" lib/common.sh && ! grep "rotate_log()" lib/common.sh | grep -v "rotate_log_once" > /dev/null 2>&1; then
echo -e "${GREEN} ✓ Log rotation optimized (once per session)${NC}"
((OPTIMIZATION_SCORE++))
else