mirror of
https://github.com/TECHNOFAB11/powerproto.git
synced 2025-12-12 08:00:04 +01:00
chore: rename package to be able to go install
This commit is contained in:
parent
538ff9c6f6
commit
507039ecc0
31 changed files with 104 additions and 99 deletions
|
|
@ -17,7 +17,7 @@ package actions
|
|||
import (
|
||||
"context"
|
||||
|
||||
"github.com/storyicon/powerproto/pkg/util/logger"
|
||||
"github.com/TECHNOFAB11/powerproto/pkg/util/logger"
|
||||
)
|
||||
|
||||
// CommonOptions is common options of action
|
||||
|
|
|
|||
|
|
@ -20,14 +20,15 @@ import (
|
|||
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/storyicon/powerproto/pkg/consts"
|
||||
"github.com/storyicon/powerproto/pkg/util"
|
||||
"github.com/storyicon/powerproto/pkg/util/logger"
|
||||
"github.com/TECHNOFAB11/powerproto/pkg/consts"
|
||||
"github.com/TECHNOFAB11/powerproto/pkg/util"
|
||||
"github.com/TECHNOFAB11/powerproto/pkg/util/logger"
|
||||
)
|
||||
|
||||
// ActionCopy is used to copy directory or file from src to dest
|
||||
// Its args prototype is:
|
||||
// args: (src string, dest string)
|
||||
//
|
||||
// args: (src string, dest string)
|
||||
func ActionCopy(ctx context.Context, log logger.Logger, args []string, options *CommonOptions) error {
|
||||
if len(args) != 2 || util.ContainsEmpty(args...) {
|
||||
return errors.Errorf("expected length of args is 3, but received %d", len(args))
|
||||
|
|
|
|||
|
|
@ -21,14 +21,15 @@ import (
|
|||
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/storyicon/powerproto/pkg/consts"
|
||||
"github.com/storyicon/powerproto/pkg/util"
|
||||
"github.com/storyicon/powerproto/pkg/util/logger"
|
||||
"github.com/TECHNOFAB11/powerproto/pkg/consts"
|
||||
"github.com/TECHNOFAB11/powerproto/pkg/util"
|
||||
"github.com/TECHNOFAB11/powerproto/pkg/util/logger"
|
||||
)
|
||||
|
||||
// ActionMove is used to move directory or file from src to dest
|
||||
// Its args prototype is:
|
||||
// args: (src string, dest string)
|
||||
//
|
||||
// args: (src string, dest string)
|
||||
func ActionMove(ctx context.Context, log logger.Logger, args []string, options *CommonOptions) error {
|
||||
if len(args) != 2 || util.ContainsEmpty(args...) {
|
||||
return errors.Errorf("expected length of args is 3, but received %d", len(args))
|
||||
|
|
|
|||
|
|
@ -21,13 +21,14 @@ import (
|
|||
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/storyicon/powerproto/pkg/consts"
|
||||
"github.com/storyicon/powerproto/pkg/util/logger"
|
||||
"github.com/TECHNOFAB11/powerproto/pkg/consts"
|
||||
"github.com/TECHNOFAB11/powerproto/pkg/util/logger"
|
||||
)
|
||||
|
||||
// ActionRemove is used to delete directories or files
|
||||
// Its args prototype is:
|
||||
// args: (path ...string)
|
||||
//
|
||||
// args: (path ...string)
|
||||
func ActionRemove(ctx context.Context, log logger.Logger, args []string, options *CommonOptions) error {
|
||||
for _, arg := range args {
|
||||
if filepath.IsAbs(arg) {
|
||||
|
|
|
|||
|
|
@ -23,14 +23,16 @@ import (
|
|||
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/storyicon/powerproto/pkg/consts"
|
||||
"github.com/storyicon/powerproto/pkg/util"
|
||||
"github.com/storyicon/powerproto/pkg/util/logger"
|
||||
"github.com/TECHNOFAB11/powerproto/pkg/consts"
|
||||
"github.com/TECHNOFAB11/powerproto/pkg/util"
|
||||
"github.com/TECHNOFAB11/powerproto/pkg/util/logger"
|
||||
)
|
||||
|
||||
// ActionReplace is used to replace text in bulk
|
||||
// Its args prototype is:
|
||||
// args: (pattern string, from string, to string)
|
||||
//
|
||||
// args: (pattern string, from string, to string)
|
||||
//
|
||||
// pattern is used to match files
|
||||
func ActionReplace(ctx context.Context, log logger.Logger, args []string, options *CommonOptions) error {
|
||||
if len(args) != 3 {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ package actionmanager
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/storyicon/powerproto/pkg/util/command"
|
||||
"github.com/TECHNOFAB11/powerproto/pkg/util/command"
|
||||
)
|
||||
|
||||
// ErrPostShell defines the post shell command error
|
||||
|
|
|
|||
|
|
@ -19,10 +19,10 @@ import (
|
|||
"fmt"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/storyicon/powerproto/pkg/component/actionmanager/actions"
|
||||
"github.com/storyicon/powerproto/pkg/configs"
|
||||
"github.com/storyicon/powerproto/pkg/util/command"
|
||||
"github.com/storyicon/powerproto/pkg/util/logger"
|
||||
"github.com/TECHNOFAB11/powerproto/pkg/component/actionmanager/actions"
|
||||
"github.com/TECHNOFAB11/powerproto/pkg/configs"
|
||||
"github.com/TECHNOFAB11/powerproto/pkg/util/command"
|
||||
"github.com/TECHNOFAB11/powerproto/pkg/util/logger"
|
||||
)
|
||||
|
||||
// ActionManager is used to manage actions
|
||||
|
|
|
|||
|
|
@ -21,12 +21,12 @@ import (
|
|||
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/storyicon/powerproto/pkg/component/pluginmanager"
|
||||
"github.com/storyicon/powerproto/pkg/configs"
|
||||
"github.com/storyicon/powerproto/pkg/consts"
|
||||
"github.com/storyicon/powerproto/pkg/util"
|
||||
"github.com/storyicon/powerproto/pkg/util/command"
|
||||
"github.com/storyicon/powerproto/pkg/util/logger"
|
||||
"github.com/TECHNOFAB11/powerproto/pkg/component/pluginmanager"
|
||||
"github.com/TECHNOFAB11/powerproto/pkg/configs"
|
||||
"github.com/TECHNOFAB11/powerproto/pkg/consts"
|
||||
"github.com/TECHNOFAB11/powerproto/pkg/util"
|
||||
"github.com/TECHNOFAB11/powerproto/pkg/util/command"
|
||||
"github.com/TECHNOFAB11/powerproto/pkg/util/logger"
|
||||
)
|
||||
|
||||
// Compiler is used to compile proto file
|
||||
|
|
@ -99,7 +99,7 @@ func (b *BasicCompiler) GetConfig(ctx context.Context) configs.ConfigItem {
|
|||
}
|
||||
|
||||
func (b *BasicCompiler) calcProtocPath(ctx context.Context) (string, error) {
|
||||
return b.pluginManager.GetPathForProtoc(ctx, b.config.Config().Protoc)
|
||||
return b.pluginManager.GetPathForProtoc(ctx, b.config.Config().Protoc)
|
||||
}
|
||||
|
||||
func (b *BasicCompiler) calcDir() string {
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
package compilermanager
|
||||
|
||||
import (
|
||||
"github.com/storyicon/powerproto/pkg/util/command"
|
||||
"github.com/TECHNOFAB11/powerproto/pkg/util/command"
|
||||
)
|
||||
|
||||
// ErrCompile defines the compile error
|
||||
|
|
|
|||
|
|
@ -18,9 +18,9 @@ import (
|
|||
"context"
|
||||
"sync"
|
||||
|
||||
"github.com/storyicon/powerproto/pkg/component/configmanager"
|
||||
"github.com/storyicon/powerproto/pkg/component/pluginmanager"
|
||||
"github.com/storyicon/powerproto/pkg/util/logger"
|
||||
"github.com/TECHNOFAB11/powerproto/pkg/component/configmanager"
|
||||
"github.com/TECHNOFAB11/powerproto/pkg/component/pluginmanager"
|
||||
"github.com/TECHNOFAB11/powerproto/pkg/util/logger"
|
||||
)
|
||||
|
||||
// CompilerManager is to manage compiler
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@ import (
|
|||
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/storyicon/powerproto/pkg/configs"
|
||||
"github.com/storyicon/powerproto/pkg/util/logger"
|
||||
"github.com/TECHNOFAB11/powerproto/pkg/configs"
|
||||
"github.com/TECHNOFAB11/powerproto/pkg/util/logger"
|
||||
)
|
||||
|
||||
// ConfigManager is used to manage config
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ package pluginmanager
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/storyicon/powerproto/pkg/util/command"
|
||||
"github.com/TECHNOFAB11/powerproto/pkg/util/command"
|
||||
)
|
||||
|
||||
// ErrGoInstall defines the go install error
|
||||
|
|
|
|||
|
|
@ -21,10 +21,10 @@ import (
|
|||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/storyicon/powerproto/pkg/util"
|
||||
"github.com/TECHNOFAB11/powerproto/pkg/util"
|
||||
|
||||
"github.com/storyicon/powerproto/pkg/util/command"
|
||||
"github.com/storyicon/powerproto/pkg/util/logger"
|
||||
"github.com/TECHNOFAB11/powerproto/pkg/util/command"
|
||||
"github.com/TECHNOFAB11/powerproto/pkg/util/logger"
|
||||
)
|
||||
|
||||
// ErrGitList defines the git list error
|
||||
|
|
|
|||
|
|
@ -22,9 +22,9 @@ import (
|
|||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/storyicon/powerproto/pkg/consts"
|
||||
"github.com/storyicon/powerproto/pkg/util"
|
||||
"github.com/storyicon/powerproto/pkg/util/logger"
|
||||
"github.com/TECHNOFAB11/powerproto/pkg/consts"
|
||||
"github.com/TECHNOFAB11/powerproto/pkg/util"
|
||||
"github.com/TECHNOFAB11/powerproto/pkg/util/logger"
|
||||
)
|
||||
|
||||
// PluginManager is used to manage plugins
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import (
|
|||
|
||||
"golang.org/x/mod/module"
|
||||
|
||||
"github.com/storyicon/powerproto/pkg/util"
|
||||
"github.com/TECHNOFAB11/powerproto/pkg/util"
|
||||
)
|
||||
|
||||
// PathForInclude is used to get the local directory of include files
|
||||
|
|
|
|||
|
|
@ -23,9 +23,9 @@ import (
|
|||
"github.com/hashicorp/go-multierror"
|
||||
jsoniter "github.com/json-iterator/go"
|
||||
|
||||
"github.com/storyicon/powerproto/pkg/util"
|
||||
"github.com/storyicon/powerproto/pkg/util/command"
|
||||
"github.com/storyicon/powerproto/pkg/util/logger"
|
||||
"github.com/TECHNOFAB11/powerproto/pkg/util"
|
||||
"github.com/TECHNOFAB11/powerproto/pkg/util/command"
|
||||
"github.com/TECHNOFAB11/powerproto/pkg/util/logger"
|
||||
)
|
||||
|
||||
// IsPluginInstalled is used to check whether a plugin is installed
|
||||
|
|
|
|||
|
|
@ -21,8 +21,8 @@ import (
|
|||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
|
||||
"github.com/storyicon/powerproto/pkg/component/pluginmanager"
|
||||
"github.com/storyicon/powerproto/pkg/util/logger"
|
||||
"github.com/TECHNOFAB11/powerproto/pkg/component/pluginmanager"
|
||||
"github.com/TECHNOFAB11/powerproto/pkg/util/logger"
|
||||
)
|
||||
|
||||
var _ = Describe("PluginManager", func() {
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ import (
|
|||
"github.com/mholt/archiver"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/storyicon/powerproto/pkg/util"
|
||||
"github.com/TECHNOFAB11/powerproto/pkg/util"
|
||||
)
|
||||
|
||||
// ProtocRelease defines the release of protoc
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue