Files
AuthCentral/dev.sh
Beyhan Oğur 8b1fbdee99 first commit
2026-04-26 21:37:58 +03:00

34 lines
1019 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# Renk kodları
GREEN='\033[0;32m'
BLUE='\033[0;34m'
RED='\033[0;31m'
NC='\033[0m' # No Color
echo -e "${GREEN}== GAuth-Central Dev Server Başlatılıyor (Local) ==${NC}"
# Go kontrolü
if ! command -v go &> /dev/null; then
echo -e "${RED}Hata: 'go' komutu bulunamadı. Lütfen Go yüklü olduğundan emin olun.${NC}"
exit 1
fi
echo -e "${BLUE}[1/4] Bağımlılıklar güncelleniyor...${NC}"
go mod tidy
# Swag kontrolü ve kurulumu
if ! command -v swag &> /dev/null; then
echo -e "${BLUE}[Info] 'swag' komutu bulunamadı, yükleniyor...${NC}"
go install github.com/swaggo/swag/cmd/swag@latest
# PATH güncellemesi gerekebilir (genelde ~/go/bin veya keyfi GOPATH/bin)
export PATH=$PATH:$(go env GOPATH)/bin
fi
echo -e "${BLUE}[2/4] Swagger dokümantasyonu oluşturuluyor...${NC}"
swag init --parseDependency
echo -e "${BLUE}[3/4] Uygulama derleniyor ve çalıştırılıyor...${NC}"
echo -e "${GREEN}Server şu adreste başlayacak: http://localhost:8080${NC}"
go run main.go