Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.idea
.idea
.DS_Store
27 changes: 27 additions & 0 deletions packages/r/intermarch3/goo-cli/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Binaries
build/
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary
*.test

# Output of the go coverage tool
*.out

# Go workspace file
go.work

# IDE
.vscode/
.idea/
*.swp
*.swo
*~

# OS
.DS_Store
Thumbs.db
78 changes: 78 additions & 0 deletions packages/r/intermarch3/goo-cli/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
.PHONY: build install test clean fmt lint help

# Binary name
BINARY_NAME=goo
BUILD_DIR=build

# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOINSTALL=$(GOCMD) install
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
GOFMT=$(GOCMD) fmt

# Build the binary
build:
@echo "Building $(BINARY_NAME)..."
@mkdir -p $(BUILD_DIR)
$(GOBUILD) -o $(BUILD_DIR)/$(BINARY_NAME) ./cmd/goo
@echo "Build complete: $(BUILD_DIR)/$(BINARY_NAME)"

# Install the binary to $GOPATH/bin
install:
@echo "Installing $(BINARY_NAME)..."
$(GOINSTALL) ./cmd/goo
@echo "Install complete!"

# Run tests
test:
@echo "Running tests..."
$(GOTEST) -v ./...

# Clean build artifacts
clean:
@echo "Cleaning..."
$(GOCLEAN)
rm -rf $(BUILD_DIR)
@echo "Clean complete!"

# Format code
fmt:
@echo "Formatting code..."
$(GOFMT) ./...
@echo "Format complete!"

# Lint code (requires golangci-lint)
lint:
@echo "Linting code..."
@if command -v golangci-lint > /dev/null; then \
golangci-lint run; \
else \
echo "golangci-lint not installed. Install it from https://golangci-lint.run/"; \
fi

# Download dependencies
deps:
@echo "Downloading dependencies..."
$(GOGET) -v ./...
@echo "Dependencies downloaded!"

# Run the CLI (for testing)
run:
@$(GOBUILD) -o $(BUILD_DIR)/$(BINARY_NAME) ./cmd/goo
@./$(BUILD_DIR)/$(BINARY_NAME)

# Show help
help:
@echo "Available targets:"
@echo " build - Build the binary"
@echo " install - Install the binary to \$$GOPATH/bin"
@echo " test - Run tests"
@echo " clean - Clean build artifacts"
@echo " fmt - Format code"
@echo " lint - Lint code (requires golangci-lint)"
@echo " deps - Download dependencies"
@echo " run - Build and run the CLI"
@echo " help - Show this help message"
Loading
Loading