Skip to content

Commit

Permalink
major: big refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
janhajek-outreach committed Jan 21, 2024
1 parent 572c814 commit 402597f
Show file tree
Hide file tree
Showing 257 changed files with 5,658 additions and 30,081 deletions.
3 changes: 0 additions & 3 deletions cmd/.gitignore

This file was deleted.

8 changes: 0 additions & 8 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,12 @@ package main
import (
"os"

"github.com/zeropsio/zcli/src/metaError"

"github.com/zeropsio/zcli/src/cmd"
)

var (
Token string
)

func main() {
cmd.BuiltinToken = Token
err := cmd.ExecuteCmd()
if err != nil {
metaError.Print(err)
os.Exit(1)
}
}
61 changes: 27 additions & 34 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,67 +1,60 @@
module github.com/zeropsio/zcli

go 1.18
go 1.21

require github.com/zeropsio/zerops-go v1.0.4

require (
github.com/aws/aws-sdk-go v1.44.77
github.com/briandowns/spinner v1.18.1
github.com/ghodss/yaml v1.0.0
github.com/golang/protobuf v1.5.2
github.com/charmbracelet/bubbles v0.16.1
github.com/charmbracelet/bubbletea v0.24.2
github.com/charmbracelet/lipgloss v0.9.1
github.com/google/uuid v1.4.0
github.com/gorilla/websocket v1.5.0
github.com/judwhite/go-svc v1.2.1
github.com/lxc/lxd v0.0.0-20220922224603-c76bc42c6393
github.com/mattn/go-isatty v0.0.20
github.com/onsi/gomega v1.10.1
github.com/peterh/liner v1.2.2
github.com/satori/go.uuid v1.2.0
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.9.0
github.com/spf13/cobra v1.5.0
github.com/spf13/viper v1.13.0
github.com/zeropsio/zerops-go v1.0.4
golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5
golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8
golang.org/x/text v0.3.7
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20220504211119-3d4a969bb56b
google.golang.org/grpc v1.49.0
google.golang.org/grpc/security/advancedtls v0.0.0-20220516211522-d9b952b17060
google.golang.org/protobuf v1.28.1
github.com/stretchr/testify v1.8.0
golang.org/x/text v0.14.0
gopkg.in/yaml.v3 v3.0.1
)

require (
cloud.google.com/go/compute v1.6.1 // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fsnotify/fsnotify v1.5.4 // indirect
github.com/google/go-cmp v0.5.8 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.0.1 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/josharian/native v1.0.0 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
github.com/mattn/go-runewidth v0.0.14 // indirect
github.com/mdlayher/genetlink v1.2.0 // indirect
github.com/mdlayher/netlink v1.6.0 // indirect
github.com/mdlayher/socket v0.2.3 // indirect
github.com/mattn/go-localereader v0.0.1 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/muesli/ansi v0.0.0-20211018074035-2e021307bc4b // indirect
github.com/muesli/cancelreader v0.2.2 // indirect
github.com/muesli/reflow v0.3.0 // indirect
github.com/muesli/termenv v0.15.2 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.5 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rivo/uniseg v0.4.2 // indirect
github.com/shopspring/decimal v1.3.1 // indirect
github.com/spf13/afero v1.9.2 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.4.1 // indirect
golang.org/x/crypto v0.0.0-20220919173607-35f4265a4bc0 // indirect
golang.org/x/net v0.0.0-20220921203646-d300de134e69 // indirect
golang.org/x/sync v0.0.0-20220907140024-f12130a52804 // indirect
golang.org/x/term v0.0.0-20220919170432-7a66f970e087 // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/term v0.15.0 // indirect
golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df // indirect
golang.zx2c4.com/wireguard v0.0.0-20220407013110-ef5c587f782d // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20220921223823-23cae91e6737 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
302 changes: 47 additions & 255 deletions go.sum

Large diffs are not rendered by default.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func (h *Handler) FindFilesByRules(workingDir string, sources []string) ([]File,
return nil, err
}

fmt.Printf(i18n.ArchClientWorkingDirectory+"\n", workingDir)
fmt.Printf(i18n.T(i18n.ArchClientWorkingDirectory)+"\n", workingDir)

// resulting function returns File from provided path
// if file shouldn't be included in the result, File.ArchivePath will be empty
Expand All @@ -35,7 +35,7 @@ func (h *Handler) FindFilesByRules(workingDir string, sources []string) ([]File,
for _, source := range sources {
parts := strings.Split(source, "~")
if len(parts) > 2 {
return nil, errors.New(i18n.ArchClientMaxOneTilde)
return nil, errors.New(i18n.T(i18n.ArchClientMaxOneTilde))
}
if len(parts) == 1 {
parts = []string{
Expand All @@ -56,9 +56,9 @@ func (h *Handler) FindFilesByRules(workingDir string, sources []string) ([]File,

if fileInfo.IsDir() {
source = strings.TrimSuffix(source, string(os.PathSeparator)) + string(os.PathSeparator)
fmt.Printf(i18n.ArchClientPackingDirectory+"\n", source)
fmt.Printf(i18n.T(i18n.ArchClientPackingDirectory)+"\n", source)
} else {
fmt.Printf(i18n.ArchClientPackingFile+"\n", source)
fmt.Printf(i18n.T(i18n.ArchClientPackingFile)+"\n", source)
}

trimPath, err := filepath.Abs(filepath.Join(workingDir, parts[0]))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"path/filepath"
"strings"

"github.com/zeropsio/zcli/src/utils/cmdRunner"
"github.com/zeropsio/zcli/src/cmdRunner"
)

func (h *Handler) FindGitFiles(workingDir string) (res []File, _ error) {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
// fixes paths/dirs that may be missing between source root and deployed files (all dirs are needed for valid TAR file)
// provided createFile func will receive a valid File.SourcePath and MUST strip workDir to form a valid File.ArchivePath
// createdPath is used as a cache to not create paths multiple times for multiple calls of the function
func (h Handler) fixMissingDirPath(files []File, createFile func(filePath string) File, createdPaths map[string]struct{}) []File {
func (h *Handler) fixMissingDirPath(files []File, createFile func(filePath string) File, createdPaths map[string]struct{}) []File {
fixedFiles := make([]File, 0, len(files)+50)

for _, file := range files {
Expand Down
File renamed without changes.
27 changes: 0 additions & 27 deletions src/cliAction/bucket/s3/handler.go

This file was deleted.

49 changes: 0 additions & 49 deletions src/cliAction/bucket/s3/handler_create.go

This file was deleted.

46 changes: 0 additions & 46 deletions src/cliAction/bucket/s3/handler_delete.go

This file was deleted.

38 changes: 0 additions & 38 deletions src/cliAction/bucket/zerops/handler.go

This file was deleted.

Loading

0 comments on commit 402597f

Please sign in to comment.