-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add new cli feature (update, exclude powerpacks) and persist co…
…nfig during init
- Loading branch information
1 parent
15a4686
commit a691489
Showing
38 changed files
with
797 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
filename: "mock_{{.InterfaceName}}.go" | ||
dir: "{{.InterfaceDir}}" | ||
mockname: "Mock{{.InterfaceName}}" | ||
outpkg: "{{.PackageName}}" | ||
inpackage: True | ||
all: True | ||
packages: | ||
github.com/merlindorin/tk: | ||
config: | ||
recursive: True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
ignore_readme: false | ||
ignore_aqua: false | ||
ignore_taskfile: false | ||
excludes: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,4 @@ includes: | |
|
||
dotenv: | ||
- .env | ||
- PROJECT | ||
- .env.default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package commands | ||
|
||
import ( | ||
"bytes" | ||
"fmt" | ||
"os" | ||
"path/filepath" | ||
|
||
ps "github.com/merlindorin/tk/pkg/powerpacks" | ||
"github.com/merlindorin/tk/powerpacks" | ||
"gopkg.in/yaml.v3" | ||
|
||
"github.com/merlindorin/go-shared/pkg/cmd" | ||
) | ||
|
||
type UpdateCmd struct { | ||
Target string `help:"target where to init tk" default:"."` | ||
} | ||
|
||
func (i *UpdateCmd) Run(_ *cmd.Commons) error { | ||
manager, err := powerpacks.BuildPowerpackManager() | ||
if err != nil { | ||
return fmt.Errorf("failed to create powerpacks: %w", err) | ||
} | ||
|
||
f, err := os.ReadFile(filepath.Join(i.Target, ".tk.yaml")) | ||
if err != nil { | ||
return fmt.Errorf("failed to read .tk.yaml: %w", err) | ||
} | ||
|
||
opts := ps.WriteOption{} | ||
|
||
err = yaml.NewDecoder(bytes.NewBuffer(f)).Decode(&opts) | ||
if err != nil { | ||
return fmt.Errorf("failed to parse .tk.yaml: %w", err) | ||
} | ||
|
||
if er := manager.Write(".", opts); er != nil { | ||
return fmt.Errorf("failed to updates powerpacks: %w", er) | ||
} | ||
|
||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package global | ||
|
||
type Taskfiles struct { | ||
type TK struct { | ||
} |
Oops, something went wrong.