1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-16 03:46:11 +00:00

🐛 update install

This commit is contained in:
Tw93
2025-09-25 20:43:39 +08:00
parent 6536b65895
commit dfaccc669e

View File

@@ -14,6 +14,7 @@ log_error() { printf "Error: %s\n" "$1"; }
INSTALL_DIR="/usr/local/bin" INSTALL_DIR="/usr/local/bin"
CONFIG_DIR="$HOME/.config/mole" CONFIG_DIR="$HOME/.config/mole"
SOURCE_DIR="" SOURCE_DIR=""
VERBOSE=0
show_help() { show_help() {
cat << 'EOF' cat << 'EOF'
@@ -239,7 +240,7 @@ verify_installation() {
# Add to PATH if needed # Add to PATH if needed
setup_path() { setup_path() {
# Only output in verbose mode # Only output in verbose mode
if [[ ${VERBOSE} -eq 1 ]]; then if [[ ${VERBOSE:-0} -eq 1 ]]; then
# Check if install directory is in PATH # Check if install directory is in PATH
if [[ ":$PATH:" == *":$INSTALL_DIR:"* ]]; then if [[ ":$PATH:" == *":$INSTALL_DIR:"* ]]; then
log_success "$INSTALL_DIR is already in PATH" log_success "$INSTALL_DIR is already in PATH"
@@ -290,9 +291,9 @@ uninstall_mole() {
# Main installation function # Main installation function
main() { main() {
if [[ ${VERBOSE} -eq 1 ]]; then if [[ ${VERBOSE:-0} -eq 1 ]]; then
echo "🕳️ Mole Installation Script" echo "Mole Installation"
echo "============================" echo "-----------------"
echo "" echo ""
fi fi
@@ -302,9 +303,9 @@ main() {
verify_installation verify_installation
setup_path setup_path
if [[ ${VERBOSE} -eq 1 ]]; then if [[ ${VERBOSE:-0} -eq 1 ]]; then
echo "" echo ""
log_success "Mole installed successfully!" log_success "Mole installed successfully"
echo "" echo ""
echo "Usage:" echo "Usage:"
if [[ ":$PATH:" == *":$INSTALL_DIR:"* ]]; then if [[ ":$PATH:" == *":$INSTALL_DIR:"* ]]; then