1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-13 01:00:13 +00:00

feat(purge): smart project discovery and optimization

This commit is contained in:
Tw93
2025-12-29 19:38:14 +08:00
parent bb83362195
commit 6328bf158d
3 changed files with 143 additions and 6 deletions

View File

@@ -7,10 +7,13 @@ set -euo pipefail
# Get script directory and source dependencies
_MOLE_MANAGE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$_MOLE_MANAGE_DIR/../core/common.sh"
source "$_MOLE_MANAGE_DIR/../clean/project.sh"
# Only source project.sh if not already loaded (has readonly vars)
if [[ -z "${PURGE_TARGETS:-}" ]]; then
source "$_MOLE_MANAGE_DIR/../clean/project.sh"
fi
# Config file path
readonly PURGE_PATHS_CONFIG="$HOME/.config/mole/purge_paths"
# Config file path (use :- to avoid re-declaration if already set)
PURGE_PATHS_CONFIG="${PURGE_PATHS_CONFIG:-$HOME/.config/mole/purge_paths}"
# Ensure config file exists with helpful template
ensure_config_template() {