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

refactor: simplify pnpm environment variable handling in clean script

This commit is contained in:
Tw93
2026-01-02 19:10:20 +08:00
parent 910e79df4e
commit d701519310
6 changed files with 25 additions and 7 deletions

View File

@@ -8,7 +8,7 @@ assignees: ''
## Describe the bug
A clear and concise description of what the bug is.
A clear and concise description of what the bug is. We suggest using English for better global understanding.
## Steps to reproduce

View File

@@ -8,7 +8,7 @@ assignees: ''
## Feature description
A clear and concise description of the feature you'd like to see.
A clear and concise description of the feature you'd like to see. We suggest using English for better global understanding.
## Use case

View File

@@ -23,11 +23,11 @@ clean_dev_npm() {
# Clean pnpm store cache
local pnpm_default_store=~/Library/pnpm/store
# Check if pnpm is actually usable (not just Corepack shim)
if command -v pnpm > /dev/null 2>&1 && env COREPACK_ENABLE_DOWNLOAD_PROMPT=0 pnpm --version > /dev/null 2>&1; then
clean_tool_cache "pnpm cache" env COREPACK_ENABLE_DOWNLOAD_PROMPT=0 pnpm store prune
if command -v pnpm > /dev/null 2>&1 && COREPACK_ENABLE_DOWNLOAD_PROMPT=0 pnpm --version > /dev/null 2>&1; then
COREPACK_ENABLE_DOWNLOAD_PROMPT=0 clean_tool_cache "pnpm cache" pnpm store prune
local pnpm_store_path
start_section_spinner "Checking store path..."
pnpm_store_path=$(run_with_timeout 2 env COREPACK_ENABLE_DOWNLOAD_PROMPT=0 pnpm store path 2> /dev/null) || pnpm_store_path=""
pnpm_store_path=$(COREPACK_ENABLE_DOWNLOAD_PROMPT=0 run_with_timeout 2 pnpm store path 2> /dev/null) || pnpm_store_path=""
stop_section_spinner
if [[ -n "$pnpm_store_path" && "$pnpm_store_path" != "$pnpm_default_store" ]]; then
safe_clean "$pnpm_default_store"/* "Orphaned pnpm store"

View File

@@ -0,0 +1 @@
dependency

View File

@@ -0,0 +1,19 @@
#!/bin/bash
if [[ "$1" == "status" ]]; then
cat << 'TMUTIL_OUTPUT'
Backup session status:
{
ClientID = "com.apple.backupd";
Running = 1;
}
TMUTIL_OUTPUT
elif [[ "$1" == "destinationinfo" ]]; then
cat << 'DEST_OUTPUT'
====================================================
Name : TestBackup
Kind : Local
Mount Point : /Volumes/TestBackup
ID : 12345678-1234-1234-1234-123456789012
====================================================
DEST_OUTPUT
fi

View File

@@ -1,2 +0,0 @@
#!/usr/bin/env bash
echo "Already on latest version"