File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,26 +56,25 @@ security: ## Run basic security checks (gosec)
5656# --- Mkcert -------------------------------
5757
5858install-mkcert : # # Install mkcert binary to $(MKCERT_INSTALL_PATH) if missing
59- @if command -v mkcert > /dev/null 2>&1 ; then \
60- echo " mkcert already installed at $$ (command -v mkcert)" ; \
61- else \
59+ @if [ ! -f " $( MKCERT_INSTALL_PATH) /mkcert" ]; then \
60+ mkdir -p $(MKCERT_INSTALL_PATH ) 2> /dev/null || true ; \
6261 echo " Downloading mkcert from $( MKCERT_URL) ..." ; \
6362 tmp=$$(mktemp -d ) ; \
6463 curl -L --fail -o $$ tmp/$(MKCERT_ASSET ) " $( MKCERT_URL) " ; \
6564 chmod +x $$ tmp/$(MKCERT_ASSET ) ; \
66- sudo mv $$ tmp/$(MKCERT_ASSET ) $(MKCERT_INSTALL_PATH ) /mkcert || { echo " Failed to move mkcert to $( MKCERT_INSTALL_PATH) " ; exit 1; }; \
65+ mv $$ tmp/$(MKCERT_ASSET ) $(MKCERT_INSTALL_PATH ) /mkcert || { echo " Failed to move mkcert to $( MKCERT_INSTALL_PATH) " ; exit 1; }; \
6766 rm -rf $$ tmp; \
6867 echo " mkcert installed to $( MKCERT_INSTALL_PATH) /mkcert" ; \
6968 fi
7069
7170mkcert-install-ca : install-mkcert # # Install mkcert CA into system trust stores
7271 @echo " Installing mkcert CA..."
73- @mkcert -install
72+ @$( MKCERT_INSTALL_PATH ) / mkcert -install
7473
7574mkcert-generate : mkcert-install-ca # # Generate cert/key for HOSTS into $(CERT_DIR) (usage: make mkcert-generate HOSTS='example.test localhost')
7675 @mkdir -p $(CERT_DIR )
7776 @echo " Generating cert for: $( HOSTS) "
78- @mkcert -cert-file $(CERT_DIR ) /smtp.crt -key-file $(CERT_DIR ) /smtp.key $(HOSTS )
77+ @$( MKCERT_INSTALL_PATH ) / mkcert -cert-file $(CERT_DIR ) /smtp.crt -key-file $(CERT_DIR ) /smtp.key $(HOSTS )
7978 @echo " Created $( CERT_DIR) /smtp.crt and $( CERT_DIR) /smtp.key"
8079
8180mkcert-uninstall-ca : install-mkcert # # Uninstall mkcert CA from system trust stores
You can’t perform that action at this time.
0 commit comments