Skip to content

Commit a85c1f1

Browse files
Merge pull request #64 from sparkfabrik/feature/improve-mkcert-installation-support
Improve mkcert installation support for multiple package managers
2 parents 5da24c5 + 55ee287 commit a85c1f1

File tree

1 file changed

+23
-10
lines changed

1 file changed

+23
-10
lines changed

bin/spark-http-proxy

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -400,17 +400,30 @@ install_mkcert() {
400400
return 0
401401
fi
402402

403-
if ! command -v brew >/dev/null 2>&1; then
404-
log_error "mkcert not found and Homebrew not available for installation"
405-
return 1
406-
fi
407-
408-
log_info "Installing mkcert with Homebrew..."
409-
if brew install mkcert nss && mkcert -install; then
410-
log_success "mkcert installed successfully"
411-
return 0
403+
# Try different package managers based on availability
404+
if command -v brew >/dev/null 2>&1; then
405+
log_info "Installing mkcert with Homebrew..."
406+
if brew install mkcert nss && mkcert -install; then
407+
log_success "mkcert installed successfully"
408+
return 0
409+
else
410+
log_error "Failed to install mkcert with Homebrew"
411+
return 1
412+
fi
413+
elif command -v pacman >/dev/null 2>&1; then
414+
log_info "Installing mkcert with pacman..."
415+
if sudo pacman -S --noconfirm nss mkcert && mkcert -install; then
416+
log_success "mkcert installed successfully"
417+
return 0
418+
else
419+
log_error "Failed to install mkcert with pacman"
420+
return 1
421+
fi
412422
else
413-
log_error "Failed to install mkcert"
423+
log_error "mkcert not found and no supported package manager available"
424+
log_info "Please install mkcert manually:"
425+
log_info " - Arch Linux: sudo pacman -S nss mkcert"
426+
log_info " - macOS: brew install mkcert nss"
414427
return 1
415428
fi
416429
}

0 commit comments

Comments
 (0)