Skip to content

Commit

Permalink
Rename project into cog
Browse files Browse the repository at this point in the history
  • Loading branch information
filariow committed Mar 14, 2022
1 parent b629571 commit ba5709f
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 24 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,17 @@ jobs:
fi
- name: Build
run: |
go build -v -o gocg ./main.go
zip gocg.zip gocg
go build -v -o cog ./main.go
zip cog.zip cog
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ env.UPLOAD_URL }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./gocg.zip
asset_name: gocg-${{ env.GOOS }}-${{ env.GOARCH }}.zip
asset_path: ./cog.zip
asset_name: cog-${{ env.GOOS }}-${{ env.GOARCH }}.zip
asset_content_type: application/zip

builddarwin:
Expand Down Expand Up @@ -106,15 +106,15 @@ jobs:
fi
- name: Build
run: |
go build -v -o gocg ./main.go
zip gocg.zip gocg
go build -v -o cog ./main.go
zip cog.zip cog
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ env.UPLOAD_URL }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./gocg.zip
asset_name: gocg-${{ env.GOOS }}-${{ env.GOARCH }}.zip
asset_content_type: application/zip
asset_path: ./cog.zip
asset_name: cog-${{ env.GOOS }}-${{ env.GOARCH }}.zip
asset_content_type: application/zip
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# gocg : go code generation
# CoG : Code Generator

A minimalist go tool to generate code from templates leveraging on the amazing go template library

Expand All @@ -10,27 +10,27 @@ A minimalist go tool to generate code from templates leveraging on the amazing g

### Prebuilt binary

You can refer to the project's [GitHub release page](https://github.com/FrancescoIlario/gocg/releases).
You can refer to the project's [GitHub release page](https://github.com/FrancescoIlario/cog/releases).

### Using Go

```
go get -u -v github.com/FrancescoIlario/gocg
go get -u -v github.com/FrancescoIlario/cog
```

## Run the example

Clone the repository in a local directory

```
git clone https://github.com/FrancescoIlario/gocg.git
cd gocg
git clone https://github.com/FrancescoIlario/cog.git
cd cog
```

Run the following command to generate the `simplego` example project from templates

```
gocg ./examples/simplego
cog ./examples/simplego
```

You can run the generated code using the following commands
Expand Down
12 changes: 6 additions & 6 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import (
"path"
"strings"

"github.com/FrancescoIlario/gocg/cg"
"github.com/FrancescoIlario/gocg/dotted"
"github.com/FrancescoIlario/cog/cg"
"github.com/FrancescoIlario/cog/dotted"
"github.com/imdario/mergo"
"github.com/spf13/cobra"
)

const (
configFileDefault = "gocg.yaml"
configFileDefault = "cog.yaml"
contextDefault = "."
outputFolderDefault = "./out/"
templateFolderDefault = "templates"
Expand All @@ -30,8 +30,8 @@ var (
)

var rootCmd = &cobra.Command{
Use: "gocg [flags] PATH",
Short: "gocg go-code-generation",
Use: "cog [flags] PATH",
Short: "cog go-code-generation",
Args: cobra.ExactValidArgs(1),
RunE: rootCmdRunE,
}
Expand Down Expand Up @@ -133,7 +133,7 @@ func existsDir(path string) bool {

func init() {
rootCmd.PersistentFlags().StringVarP(&outputFolder, "outdir", "o", outputFolderDefault, "The path where to store the generated code")
rootCmd.PersistentFlags().StringVarP(&configFilePath, "config", "c", "", "The path to the config file to use (default gocg.yaml in context folder)")
rootCmd.PersistentFlags().StringVarP(&configFilePath, "config", "c", "", "The path to the config file to use (default cog.yaml in context folder)")
rootCmd.PersistentFlags().StringVarP(&templateFolderName, "template", "t", templateFolderDefault, "The template folder in the context one")
rootCmd.Flags().StringArrayVarP(&set, "set", "s", []string{}, "override a prop from yaml (path.to.key=value)")
rootCmd.Flags().StringVarP(&ext, "ext", "e", "t", "set the extension of the template files")
Expand Down
2 changes: 1 addition & 1 deletion dotted/dotted_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package dotted_test
import (
"testing"

"github.com/FrancescoIlario/gocg/dotted"
"github.com/FrancescoIlario/cog/dotted"
"github.com/matryer/is"
)

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/FrancescoIlario/gocg
module github.com/FrancescoIlario/cog

go 1.15

Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"os"

"github.com/FrancescoIlario/gocg/cmd"
"github.com/FrancescoIlario/cog/cmd"
)

func main() {
Expand Down

0 comments on commit ba5709f

Please sign in to comment.