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
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
run: |
export AppVersion="${{ env.RELEASE_VERSION }}"
echo "Building version: $AppVersion"
make build-all
make dist

- name: Archive build artifacts
uses: actions/upload-artifact@v3
Expand Down
14 changes: 13 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,37 @@ uninstall:
build:
go build -ldflags="$(LDFLAGS)" -o gozen

build-all:
dist:
GOOS=linux GOARCH=amd64 go build -ldflags="$(LDFLAGS)" -o build/gozen-linux-amd64
cp build/gozen-linux-amd64 build/gozen
tar -zcvf build/gozen-linux-amd64.tar.gz build/gozen man/gozen.1
cd build && sha256sum gozen-linux-amd64.tar.gz > checksum-sha256sum.txt

GOOS=linux GOARCH=arm64 go build -ldflags="$(LDFLAGS)" -o build/gozen-linux-arm64
cp build/gozen-linux-arm64 build/gozen
tar -zcvf build/gozen-linux-arm64.tar.gz build/gozen man/gozen.1
cd build && sha256sum gozen-linux-arm64.tar.gz >> checksum-sha256sum.txt

GOOS=linux GOARCH=arm go build -ldflags="$(LDFLAGS)" -o build/gozen-linux-arm
cp build/gozen-linux-arm build/gozen
tar -zcvf build/gozen-linux-arm.tar.gz build/gozen man/gozen.1
cd build && sha256sum gozen-linux-arm.tar.gz >> checksum-sha256sum.txt

GOOS=darwin GOARCH=amd64 go build -ldflags="$(LDFLAGS)" -o build/gozen-darwin-amd64
cp build/gozen-darwin-amd64 build/gozen
tar -zcvf build/gozen-darwin-amd64.tar.gz build/gozen man/gozen.1
cd build && sha256sum gozen-darwin-amd64.tar.gz >> checksum-sha256sum.txt

GOOS=darwin GOARCH=arm64 go build -ldflags="$(LDFLAGS)" -o build/gozen-darwin-arm64
cp build/gozen-darwin-arm64 build/gozen
tar -zcvf build/gozen-darwin-arm64.tar.gz build/gozen man/gozen.1
cd build && sha256sum gozen-darwin-arm64.tar.gz >> checksum-sha256sum.txt
rm build/gozen

GOOS=windows GOARCH=amd64 go build -ldflags="$(LDFLAGS)" -o build/gozen-windows-amd64.exe
cd build && sha256sum gozen-windows-amd64.exe >> checksum-sha256sum.txt
GOOS=windows GOARCH=386 go build -ldflags="$(LDFLAGS)" -o build/gozen-windows-i386.exe
cd build && sha256sum gozen-windows-i386.exe >> checksum-sha256sum.txt

clean:
rm -rf gozen*
Expand Down
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,27 @@ Download and install executable binary from GitHub releases page.

### Linux Installation
```sh
curl -sL https://github.com/tech-thinker/gozen/releases/download/v1.0.0/gozen-linux-amd64 -o gozen
curl -sL https://github.com/tech-thinker/gozen/releases/download/v0.1.1/gozen-linux-amd64 -o gozen
chmod +x gozen
sudo mv gozen /usr/bin
```

### MacOS Installation
```sh
curl -sL https://github.com/tech-thinker/gozen/releases/download/v1.0.0/gozen-darwin-amd64 -o gozen
curl -sL https://github.com/tech-thinker/gozen/releases/download/v0.1.1/gozen-darwin-amd64 -o gozen
chmod +x gozen
sudo mv gozen /usr/bin
```

- Or using homebrew
```sh
brew tap tech-thinker/tap
brew install gozen
```

### Windows Installation
```sh
curl -sL https://github.com/tech-thinker/gozen/releases/download/v1.0.0/gozen-windows-amd64.exe -o gozen.exe
curl -sL https://github.com/tech-thinker/gozen/releases/download/v0.1.1/gozen-windows-amd64.exe -o gozen.exe
gozen.exe
```

Expand Down
6 changes: 5 additions & 1 deletion cmd/create_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ type appCmd struct {
}

func (cmd *appCmd) CreateApp() error {
appPath := fmt.Sprintf(`%s/%s`, constants.CURRENT_WORKING_DIRECTORY, cmd.project.AppName)
workDir := constants.CURRENT_WORKING_DIRECTORY
if len(cmd.project.WorkingDir) > 1 {
workDir = cmd.project.WorkingDir
}
appPath := fmt.Sprintf(`%s/%s`, workDir, cmd.project.AppName)
fmt.Println("Project created at location: " + appPath)
utils.CreateDirectory(appPath)
// Write project config into file
Expand Down
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ func main() {
AppName: ctx.Args().Get(0),
PackageName: packageName,
Driver: driver,
WorkingDir: outputDir,
}
app := cmd.NewAppCmd(project, helper)

Expand Down
4 changes: 2 additions & 2 deletions man/gozen.1
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
.TH GOZEN 1 "September 25, 2024" "Version 0.1.0" "User Commands"
.TH GOZEN 1 "September 25, 2024" "Version 0.1.1" "User Commands"
.SH NAME
gozen \- is a simplified golang MVC framework to generate projects and components.
.SH SYNOPSIS
.B gozen
.RI "command " [ options ] " <args>"
.SH DESCRIPTION
is a command-line interface (CLI) tool that simplifies the creation of projects and components in a Go application.
gozen is a command-line interface (CLI) tool that simplifies the creation of projects and components in a Go application.

This application is a set of tools that can be used to generate a project structure and a set of components that can be used to build a Go application.

Expand Down
8 changes: 7 additions & 1 deletion models/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ type Project struct {
AppName string `json:"app_name"`
PackageName string `json:"package_name"`
Driver string `json:"driver"`
WorkingDir string `json:"-"`
}

func (p Project) ToJSON() string {
Expand Down Expand Up @@ -42,7 +43,12 @@ func (p *Project) LoadFromJsonFile() error {
}

func (p Project) WriteToJsonFile() error {
filename := fmt.Sprintf(`%s/%s/gozen.json`, constants.CURRENT_WORKING_DIRECTORY, p.AppName)
workDir := constants.CURRENT_WORKING_DIRECTORY
if len(p.WorkingDir) > 1 {
workDir = p.WorkingDir
}

filename := fmt.Sprintf(`%s/%s/gozen.json`, workDir, p.AppName)
file, err := os.Create(filename)
if err != nil {
return err
Expand Down
Loading