Skip to content

Commit

Permalink
Merge pull request #113 from create-go-app/dev
Browse files Browse the repository at this point in the history
Fix project problem (GoLand)
  • Loading branch information
koddr authored Jan 3, 2022
2 parents 9323c31 + 5d5815b commit 57b77e5
Show file tree
Hide file tree
Showing 16 changed files with 43 additions and 22 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ LICENSE
# Folders
.git/
.github/
.vscode/
.idea/
tmp/
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# macOS
**/.DS_Store

# IDE
.vscode/
.idea/

# Dev builds
**/build/
**/dist/
Expand Down
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ brews:
owner: create-go-app
name: homebrew-cli

# Template for the url which is determined by the given Token (github or gitlab)
# Template for the url which is determined by the given Token (GitHub or gitlab)
# Default for github is "https://github.com/<repo_owner>/<repo_name>/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
url_template: "https://github.com/create-go-app/cli/releases/download/{{ .Tag }}/{{ .ArtifactName }}"

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2021 Vic Shóstak and Create Go App Contributors
Copyright 2022 Vic Shóstak and Create Go App Contributors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
3 changes: 2 additions & 1 deletion cmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ import (
"time"

"github.com/AlecAivazis/survey/v2"
"github.com/spf13/cobra"

"github.com/create-go-app/cli/v3/pkg/cgapp"
"github.com/create-go-app/cli/v3/pkg/registry"
"github.com/spf13/cobra"
)

func init() {
Expand Down
3 changes: 2 additions & 1 deletion cmd/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ import (
"fmt"
"time"

"github.com/spf13/cobra"

"github.com/create-go-app/cli/v3/pkg/cgapp"
"github.com/create-go-app/cli/v3/pkg/registry"
"github.com/spf13/cobra"
)

func init() {
Expand Down
7 changes: 4 additions & 3 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ package cmd

import (
"github.com/AlecAivazis/survey/v2"
"github.com/spf13/cobra"

"github.com/create-go-app/cli/v3/pkg/cgapp"
"github.com/create-go-app/cli/v3/pkg/registry"
"github.com/spf13/cobra"
)

var (
Expand Down Expand Up @@ -39,8 +40,8 @@ var rootCmd = &cobra.Command{
Long: `
A powerful CLI for the Create Go App project.
Create a new production-ready project with backend (Golang),
frontend (JavaScript, TypeScript) and deploy automation
Create a new production-ready project with backend (Golang),
frontend (JavaScript, TypeScript) and deploy automation
(Ansible, Docker) by running one CLI command.
-> Focus on writing code and thinking of business logic!
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (

require (
github.com/Microsoft/go-winio v0.5.1 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20211112122917-428f8eabeeb3 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20211221144345-a4f6767435ab // indirect
github.com/acomagu/bufpipe v1.0.3 // indirect
github.com/emirpasic/gods v1.12.0 // indirect
github.com/go-git/gcfg v1.5.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ github.com/Netflix/go-expect v0.0.0-20180615182759-c93bf25de8e8 h1:xzYJEypr/85nB
github.com/Netflix/go-expect v0.0.0-20180615182759-c93bf25de8e8/go.mod h1:oX5x61PbNXchhh0oikYAH+4Pcfw5LKv21+Jnpr6r6Pc=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7/go.mod h1:z4/9nQmJSSwwds7ejkxaJwO37dru3geImFUdJlaLzQo=
github.com/ProtonMail/go-crypto v0.0.0-20211112122917-428f8eabeeb3 h1:XcF0cTDJeiuZ5NU8w7WUDge0HRwwNRmxj/GGk6KSA6g=
github.com/ProtonMail/go-crypto v0.0.0-20211112122917-428f8eabeeb3/go.mod h1:z4/9nQmJSSwwds7ejkxaJwO37dru3geImFUdJlaLzQo=
github.com/ProtonMail/go-crypto v0.0.0-20211221144345-a4f6767435ab h1:5FiL/TCaiKCss/BLMIACDxxadYrx767l9kh0qYX+sLQ=
github.com/ProtonMail/go-crypto v0.0.0-20211221144345-a4f6767435ab/go.mod h1:z4/9nQmJSSwwds7ejkxaJwO37dru3geImFUdJlaLzQo=
github.com/acomagu/bufpipe v1.0.3 h1:fxAGrHZTgQ9w5QqVItgzwj235/uYZYgbXitB+dLupOk=
github.com/acomagu/bufpipe v1.0.3/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
Expand Down
2 changes: 1 addition & 1 deletion pkg/cgapp/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
func ExecCommand(command string, options []string, silentMode bool) error {
// Checking for nil.
if command == "" || options == nil {
return fmt.Errorf("No command to execute!")
return fmt.Errorf("no command to execute")
}

// Create buffer for stderr.
Expand Down
2 changes: 1 addition & 1 deletion pkg/cgapp/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"text/template"
)

// EmbeddedFileSystems struct contains embedded file system fields.
// EmbeddedFileSystem struct contains embedded file system fields.
type EmbeddedFileSystem struct {
Name embed.FS
RootFolder string
Expand Down
10 changes: 8 additions & 2 deletions pkg/cgapp/files_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ func TestMakeFile(t *testing.T) {
})

// Clean
os.RemoveAll("Makefile")
err := os.RemoveAll("Makefile")
if err != nil {
return
}
}
}

Expand Down Expand Up @@ -99,7 +102,10 @@ func TestMakeFolder(t *testing.T) {
})

// Clean
os.RemoveAll(tt.args.folderName)
err := os.RemoveAll(tt.args.folderName)
if err != nil {
return
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/cgapp/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
func GitClone(templateType, templateURL string) error {
// Checking for nil.
if templateType == "" || templateURL == "" {
return fmt.Errorf("Project template not found!")
return fmt.Errorf("project template not found")
}

// Get current directory.
Expand Down
5 changes: 4 additions & 1 deletion pkg/cgapp/git_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ func TestGitClone(t *testing.T) {
})

// Clean
os.RemoveAll("../../tmp")
err := os.RemoveAll("../../tmp")
if err != nil {
return
}
}
}
13 changes: 8 additions & 5 deletions pkg/cgapp/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ func ShowMessage(level, text string, startWithNewLine, endWithNewLine bool) {
message := fmt.Sprintf("%s %s %s %s", startLine, colorizeLevel(level), text, endLine)

// Return output.
fmt.Fprintln(Stdout, message)
_, err := fmt.Fprintln(Stdout, message)
if err != nil {
return
}
}

// ShowError function for send error message to output.
Expand All @@ -50,10 +53,10 @@ func CalculateDurationTime(startTimer time.Time) string {
func colorizeLevel(level string) string {
// Define variables.
var (
red string = "\033[0;31m"
green string = "\033[0;32m"
yellow string = "\033[1;33m"
noColor string = "\033[0m"
red = "\033[0;31m"
green = "\033[0;32m"
yellow = "\033[1;33m"
noColor = "\033[0m"
color, icon string
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/registry/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

// CLIVersion version of Create Go App CLI.
const CLIVersion string = "3.3.0"
const CLIVersion string = "3.3.1"

// Variables struct for Ansible variables (inventory, hosts).
type Variables struct {
Expand Down

0 comments on commit 57b77e5

Please sign in to comment.