mirror of
https://github.com/tw93/Mole.git
synced 2026-02-15 12:15:08 +00:00
Merge branch 'main' of github.com:tw93/Mole
This commit is contained in:
@@ -37,7 +37,7 @@ clean_dev_npm() {
|
|||||||
clean_tool_cache "pnpm cache" pnpm store prune
|
clean_tool_cache "pnpm cache" pnpm store prune
|
||||||
# Get the actual store path to check if default is orphaned
|
# Get the actual store path to check if default is orphaned
|
||||||
local pnpm_store_path
|
local pnpm_store_path
|
||||||
pnpm_store_path=$(run_with_timeout 5 pnpm store path 2>/dev/null) || pnpm_store_path=""
|
pnpm_store_path=$(run_with_timeout 5 pnpm store path 2> /dev/null) || pnpm_store_path=""
|
||||||
# If store path is different from default, clean the orphaned default
|
# If store path is different from default, clean the orphaned default
|
||||||
if [[ -n "$pnpm_store_path" && "$pnpm_store_path" != "$pnpm_default_store" ]]; then
|
if [[ -n "$pnpm_store_path" && "$pnpm_store_path" != "$pnpm_default_store" ]]; then
|
||||||
safe_clean "$pnpm_default_store"/* "pnpm store (orphaned)"
|
safe_clean "$pnpm_default_store"/* "pnpm store (orphaned)"
|
||||||
@@ -108,8 +108,24 @@ clean_dev_docker() {
|
|||||||
if run_with_timeout 3 docker info > /dev/null 2>&1; then
|
if run_with_timeout 3 docker info > /dev/null 2>&1; then
|
||||||
clean_tool_cache "Docker build cache" docker builder prune -af
|
clean_tool_cache "Docker build cache" docker builder prune -af
|
||||||
else
|
else
|
||||||
|
if [[ -t 0 ]]; then
|
||||||
|
echo -ne " ${YELLOW}${ICON_WARNING}${NC} Docker not running. ${GRAY}Enter${NC} retry / ${GRAY}any key${NC} skip: "
|
||||||
|
local key
|
||||||
|
IFS= read -r -s -n1 key || key=""
|
||||||
|
printf "\r\033[2K"
|
||||||
|
if [[ -z "$key" || "$key" == $'\n' || "$key" == $'\r' ]]; then
|
||||||
|
if run_with_timeout 3 docker info > /dev/null 2>&1; then
|
||||||
|
clean_tool_cache "Docker build cache" docker builder prune -af
|
||||||
|
else
|
||||||
|
echo -e " ${GRAY}${ICON_SUCCESS}${NC} Docker build cache (still not running)"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo -e " ${GRAY}${ICON_SUCCESS}${NC} Docker build cache (skipped)"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo -e " ${GRAY}${ICON_SUCCESS}${NC} Docker build cache (daemon not running)"
|
||||||
|
fi
|
||||||
note_activity
|
note_activity
|
||||||
echo -e " ${GRAY}${ICON_SUCCESS}${NC} Docker build cache (daemon not running)"
|
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
note_activity
|
note_activity
|
||||||
|
|||||||
Reference in New Issue
Block a user