Skip to content
Merged
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
11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ clean:

generate-mocks:
# Mockery version v2.50.0
@mockery --name=ShellWrapper --dir=wrappers --output=wrappers --outpkg=wrappers --filename=shell_wrapper_mock.go --structname=ShellWrapperMock
@mockery --name=FileSystemWrapper --dir=wrappers --output=wrappers --outpkg=wrappers --filename=file_system_wrapper_mock.go --structname=FileSystemWrapperMock
# @mockery --name=FileSystemWrapper --dir=cmd/wrappers --output=cmd/wrappers --outpkg=wrappers --filename=file_system_repo_mock.go --structname=FileSystemWrapperMock
# Wrapper
@mockery --name=ShellWrapper --dir=wrappers --output=wrappers --outpkg=wrappers --filename=shellWrapper_mock.go --structname=ShellWrapperMock
@mockery --name=FileSystemWrapper --dir=wrappers --output=wrappers --outpkg=wrappers --filename=fileSystemWrapper_mock.go --structname=FileSystemWrapperMock
# Repository
@mockery --name=SystemRepo --dir=cmd/repository --output=cmd/repository --outpkg=repository --filename=system_mock.go --structname=SystemRepoMock
@mockery --name=ProjectRepo --dir=cmd/repository --output=cmd/repository --outpkg=repository --filename=project_mock.go --structname=ProjectRepoMock
# Helpers
@mockery --name=ProjectHelper --dir=cmd/helpers --output=cmd/helpers --outpkg=helpers --filename=projectHelper_mock.go --structname=ProjectHelperMock
243 changes: 243 additions & 0 deletions cmd/helpers/projectHelper_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 45 additions & 0 deletions cmd/repository/project_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions cmd/repository/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,15 @@ import (
"github.com/tech-thinker/gozen/wrappers"
)

// SystemRepo is an interface that defines methods for interacting with the system. This includes writing files, executing shell commands, and managing the file system.
type SystemRepo interface {
// Write generates code from a template and writes it to a file.
Write(appDir string, templatePath string, destination string, data interface{}) error
// WriteAll generates code from multiple templates and writes them to their respective files.
WriteAll(appDir string, fileConfigs []models.FileConfig, data interface{}) error
// ExecShell executes a shell command with arguments and returns the output as a string slice.
ExecShell(command string, args ...string) ([]string, error)
// ExecShellRaw executes a shell command with arguments and returns the raw byte output.
ExecShellRaw(command string, args ...string) ([]byte, error)
}

Expand Down
Loading
Loading