diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 5870cacc..ee5679c1 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -1,28 +1,35 @@ -# This workflow will build a golang project -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go - name: Go on: - push: - branches: [ "main" ] pull_request: branches: [ "main" ] + push: + branches: [ "main" ] jobs: - + Fleet: - runs-on: ubuntu-latest - + steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v3 + + - name: Setup Go environment + uses: actions/setup-go@v5.1.0 + with: + go-version: 1.23.x + + - name: Check Go environment + run: go version - - name: Set up Go - uses: actions/setup-go@v4 - with: - go-version: 1.23.x + - name: Install dependencies + run: go get -v -t -d ./... - - name: Build - run: go build -v ./... + - name: Install golangci-lint + run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest + - name: Run golangci-lint + run: golangci-lint run ./... + + - name: Build + run: go build -o resq diff --git a/CLI/cmd.go b/CLI/cmd.go index acbe68c2..60e29011 100644 --- a/CLI/cmd.go +++ b/CLI/cmd.go @@ -15,8 +15,11 @@ package cli import ( + "fleet/ai" "fleet/handlers" "fleet/handlers/list" + "fmt" + "github.com/spf13/cobra" ) @@ -58,15 +61,15 @@ func Command() *cobra.Command { }, }, &cobra.Command{ - Use: "update [package]", - Short: "Update a package", + Use: "ai [question]", + Short: "AI assistant", Args: cobra.ExactArgs(1), Run: func(cmd *cobra.Command, args []string) { - // handlers.Update(args[0]) + result := ai.ResponseAi(args[0]) + fmt.Println(result) }, }, ) return rootCmd } - diff --git a/Formulas/aircrack-ng.go b/Formulas/aircrack-ng.go index f95502f0..ceb2b23d 100644 --- a/Formulas/aircrack-ng.go +++ b/Formulas/aircrack-ng.go @@ -94,7 +94,6 @@ func downloadFile(filepath string, url string) error { return err } - func unzip(src string, dest string) error { r, err := zip.OpenReader(src) if err != nil { @@ -105,7 +104,9 @@ func unzip(src string, dest string) error { for _, f := range r.File { fPath := filepath.Join(dest, f.Name) if f.FileInfo().IsDir() { - os.MkdirAll(fPath, os.ModePerm) + if err := os.MkdirAll(fPath, os.ModePerm); err != nil { + return err + } continue } @@ -140,4 +141,3 @@ func runCommand(name string, args ...string) error { cmd.Stderr = os.Stderr return cmd.Run() } - diff --git a/Formulas/bat.go b/Formulas/bat.go index 7bdcfdf5..084b9d90 100644 --- a/Formulas/bat.go +++ b/Formulas/bat.go @@ -16,24 +16,34 @@ package formulas import ( "fmt" + "os" "os/exec" "runtime" ) +func InstallBat() { -func InstallBat(){ + switch runtime.GOOS { + case "darwin": + installBazelMac() + default: + fmt.Println("OS No Support") + } - switch runtime.GOOS { - case "darwin": - installBazelMac() - default: - fmt.Println("OS No Support") - } - } -func InstallBatMac(){ - url := "https://github.com/sharkdp/bat/releases/download/v0.24.0/bat-v0.24.0-x86_64-apple-darwin.tar.gz" - download := exec.Command("curl", "-L", url, "-o", "bat.tar.gz") - download.Run() - } +func InstallBatMac() { + url := "https://github.com/sharkdp/bat/releases/download/v0.24.0/bat-v0.24.0-x86_64-apple-darwin.tar.gz" + download := exec.Command("curl", "-L", url, "-o", "bat.tar.gz") + if err := download.Run(); err != nil { + fmt.Println("Error downloading bat:", err) + return + } + defer os.Remove("bat.tar.gz") + + extract := exec.Command("tar", "-xzf", "bat.tar.gz") + if err := extract.Run(); err != nil { + fmt.Println("Error extracting bat:", err) + return + } +} diff --git a/Formulas/burpsuite.go b/Formulas/burpsuite.go index 8fcff6cc..4e6f5255 100644 --- a/Formulas/burpsuite.go +++ b/Formulas/burpsuite.go @@ -15,20 +15,24 @@ package formulas import ( - "runtime" - "os/exec" + "fmt" + "os/exec" + "runtime" ) -func InstallBurpSuite(){ - switch runtime.GOARCH{ - case "arm64": - InstallBurpSuiteMac("https://portswigger.net/burp/releases/community/latest") - case "amd64": - InstallBurpSuiteMac("https://portswigger.net/burp/releases/community/latest") - } +func InstallBurpSuite() { + switch runtime.GOARCH { + case "arm64": + InstallBurpSuiteMac("https://portswigger.net/burp/releases/community/latest") + case "amd64": + InstallBurpSuiteMac("https://portswigger.net/burp/releases/community/latest") + } } -func InstallBurpSuiteMac(url string){ - download := exec.Command("curl", "-L", url) - download.Run() +func InstallBurpSuiteMac(url string) { + download := exec.Command("curl", "-L", url) + if err := download.Run(); err != nil { + fmt.Println("Error downloading burpsuite:", err) + return + } } diff --git a/Formulas/docker.go b/Formulas/docker.go index 819e73bc..0db150f2 100644 --- a/Formulas/docker.go +++ b/Formulas/docker.go @@ -51,7 +51,10 @@ func installDockerMac(url string) { install := exec.Command("sudo", "/Volumes/Docker/Docker.app/Contents/MacOS/install") if err := install.Run(); err != nil { redBold.Println("Error installing Docker:", err) - exec.Command("hdiutil", "detach", "/Volumes/Docker").Run() // Desmontar en caso de error + if err := exec.Command("sudo", "rm", "-rf", "/Volumes/Docker").Run(); err != nil { + redBold.Println("Error cleaning up the disk image:", err) + return + } return } diff --git a/Formulas/git.go b/Formulas/git.go index a5a1e08c..2787d2fa 100644 --- a/Formulas/git.go +++ b/Formulas/git.go @@ -15,6 +15,7 @@ package formulas import ( + "os" "os/exec" "runtime" ) @@ -50,18 +51,55 @@ func installGitMac() { pkgPath := "/Volumes/Git 2.2.1 Mavericks Intel Universal/git-2.2.1-intel-universal-mavericks.pkg" if err := exec.Command("test", "-f", pkgPath).Run(); err != nil { redBold.Println("Error finding the .pkg file:", err) - exec.Command("hdiutil", "detach", "/Volumes/Git 2.2.1 Intel Universal Mavericks").Run() // Desmontar en caso de error + if err := exec.Command("hdiutil", "detach", "/Volumes/Git 2.2.1 Mavericks Intel Universal/").Run(); err != nil { + redBold.Println("Error detaching the disk image:", err) + return + } return } yellow.Println("Installing Git from the package...") - install := exec.Command("sudo", "installer", "-pkg", pkgPath, "-target", "/") - if err := install.Run(); err != nil { + if err := exec.Command("sudo", "installer", "-pkg", pkgPath, "-target", "/").Run(); err != nil { redBold.Println("Error installing Git:", err) - exec.Command("hdiutil", "detach", "/Volumes/Git 2.2.1 Intel Universal Mavericks").Run() // Desmontar en caso de error + if err := exec.Command("hdiutil", "detach", "/Volumes/Git 2.2.1 Mavericks Intel Universal/").Run(); err != nil { + redBold.Println("Error detaching the disk image:", err) + return + } return } + zipFile := "git.zip" + download = exec.Command("curl", "-L", "https://github.com/git-for-windows/git/releases/download/v2.38.1.windows.1/Git-2.38.1-64-bit.zip", "-o", zipFile) + if err := download.Run(); err != nil { + redBold.Println("Error downloading Git:", err) + if err := exec.Command("hdiutil", "detach", "/Volumes/Git 2.2.1 Mavericks Intel Universal/").Run(); err != nil { + redBold.Println("Error detaching the disk image:", err) + return + } + return + } + defer os.Remove(zipFile) + + yellow.Println("Extracting Git...") + unzip := exec.Command("unzip", zipFile) + if err := unzip.Run(); err != nil { + redBold.Println("Error extracting Git:", err) + if err := exec.Command("hdiutil", "detach", "/Volumes/Git 2.2.1 Mavericks Intel Universal/").Run(); err != nil { + redBold.Println("Error detaching the disk image:", err) + return + } + return + } + + install := exec.Command("sudo", "installer", "-pkg", "/Volumes/Git/Git.app/Contents/Resources/git-installer.pkg", "-target", "/") + if err := install.Run(); err != nil { + redBold.Println("Error installing Git:", err) + if err := exec.Command("hdiutil", "detach", "/Volumes/Git 2.2.1 Mavericks Intel Universal/").Run(); err != nil { + redBold.Println("Error detaching the disk image:", err) + return + } + } + yellow.Println("Unmounting the disk image...") detach := exec.Command("hdiutil", "detach", "/Volumes/Git 2.2.1 Mavericks Intel Universal/") if err := detach.Run(); err != nil { diff --git a/ai/ai.go b/ai/ai.go index 94507557..53878e3e 100644 --- a/ai/ai.go +++ b/ai/ai.go @@ -1,12 +1,10 @@ package ai - -// This functionality is not available yet, it is not ready and it has bugs import ( "bytes" "encoding/json" "fmt" - "io/ioutil" + "io" "net/http" "strings" "text/tabwriter" @@ -15,7 +13,7 @@ import ( type Message struct { Content string `json:"content"` - ID string `json:"id"` + ID string `json:"id"` Role string `json:"role"` CreatedAt string `json:"createdAt"` } @@ -64,7 +62,7 @@ func wrapText(text string, width int) string { return buf.String() } -func ResponseAi(question string) { +func ResponseAi(question string) error { url := "https://www.blackbox.ai/api/chat" messages := []Message{ @@ -88,32 +86,28 @@ func ResponseAi(question string) { jsonData, err := json.Marshal(requestBody) if err != nil { - fmt.Println("Error converting to JSON:", err) - return + return fmt.Errorf("error converting to JSON: %w", err) } resp, err := http.Post(url, "application/json", bytes.NewBuffer(jsonData)) if err != nil { - fmt.Println("Error making request:", err) - return + return fmt.Errorf("error making request: %w", err) } defer resp.Body.Close() - body, err := ioutil.ReadAll(resp.Body) + body, err := io.ReadAll(resp.Body) // Reemplazado ioutil.ReadAll con io.ReadAll if err != nil { - fmt.Println("Error reading response:", err) - return + return fmt.Errorf("error reading response: %w", err) } responseStr := string(body) - parts := strings.Split(responseStr, "$@$") if len(parts) > 2 { responseStr = parts[2] - } else { - responseStr = responseStr } - typingAnimation(wrapText(responseStr, 20), 13*time.Millisecond) -} + fmt.Println("\nAI is typing...") + typingAnimation(wrapText(responseStr, 60), 30*time.Millisecond) + return nil +} diff --git a/go.mod b/go.mod index 7da5b074..4f101ed5 100644 --- a/go.mod +++ b/go.mod @@ -1,250 +1,250 @@ -module fleet - -go 1.23 - -require ( - github.com/gookit/color v1.5.4 - github.com/spf13/cobra v1.8.1 -) - -require ( - aead.dev/minisign v0.2.0 // indirect - git.mills.io/prologic/smtpd v0.0.0-20210710122116-a525b76c287a // indirect - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.0 // indirect - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0 // indirect - github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect - github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.1.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0 // indirect - github.com/DataDog/gostackparse v0.6.0 // indirect - github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible // indirect - github.com/Masterminds/semver/v3 v3.2.1 // indirect - github.com/Microsoft/go-winio v0.5.2 // indirect - github.com/Mzack9999/gcache v0.0.0-20230410081825-519e28eab057 // indirect - github.com/Mzack9999/go-http-digest-auth-client v0.6.1-0.20220414142836-eb8883508809 // indirect - github.com/Mzack9999/ldapserver v1.0.2-0.20211229000134-b44a0d6ad0dd // indirect - github.com/ProtonMail/go-crypto v0.0.0-20230518184743-7afd39499903 // indirect - github.com/PuerkitoBio/goquery v1.10.0 // indirect - github.com/VividCortex/ewma v1.2.0 // indirect - github.com/acomagu/bufpipe v1.0.4 // indirect - github.com/akrylysov/pogreb v0.10.1 // indirect - github.com/alecthomas/chroma v0.10.0 // indirect - github.com/alecthomas/jsonschema v0.0.0-20211022214203-8b29eab41725 // indirect - github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect - github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect - github.com/andybalholm/brotli v1.0.5 // indirect - github.com/andybalholm/cascadia v1.3.2 // indirect - github.com/andygrunwald/go-jira v1.16.0 // indirect - github.com/antchfx/htmlquery v1.3.0 // indirect - github.com/antchfx/xmlquery v1.3.15 // indirect - github.com/antchfx/xpath v1.2.3 // indirect - github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect - github.com/aws/aws-sdk-go-v2 v1.19.0 // indirect - github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10 // indirect - github.com/aws/aws-sdk-go-v2/config v1.18.28 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.13.27 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.5 // indirect - github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.72 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.35 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.29 // indirect - github.com/aws/aws-sdk-go-v2/internal/ini v1.3.36 // indirect - github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.27 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.11 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.30 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.29 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.14.4 // indirect - github.com/aws/aws-sdk-go-v2/service/s3 v1.37.0 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.12.13 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.13 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.19.3 // indirect - github.com/aws/smithy-go v1.13.5 // indirect - github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect - github.com/aymerick/douceur v0.2.0 // indirect - github.com/bits-and-blooms/bitset v1.8.0 // indirect - github.com/bits-and-blooms/bloom/v3 v3.5.0 // indirect - github.com/bluele/gcache v0.0.2 // indirect - github.com/caddyserver/certmagic v0.19.2 // indirect - github.com/charmbracelet/glamour v0.6.0 // indirect - github.com/cheggaaa/pb/v3 v3.1.4 // indirect - github.com/cloudflare/cfssl v1.6.4 // indirect - github.com/cloudflare/circl v1.3.3 // indirect - github.com/cnf/structhash v0.0.0-20201127153200-e1b16c1ebc08 // indirect - github.com/corpix/uarand v0.2.0 // indirect - github.com/dimchansky/utfbom v1.1.1 // indirect - github.com/dlclark/regexp2 v1.8.1 // indirect - github.com/docker/go-units v0.5.0 // indirect - github.com/dsnet/compress v0.0.1 // indirect - github.com/emirpasic/gods v1.18.1 // indirect - github.com/fatih/color v1.17.0 // indirect - github.com/fatih/structs v1.1.0 // indirect - github.com/gabriel-vasile/mimetype v1.4.2 // indirect - github.com/gaukas/godicttls v0.0.4 // indirect - github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect - github.com/go-git/go-billy/v5 v5.4.1 // indirect - github.com/go-git/go-git/v5 v5.7.0 // indirect - github.com/go-ole/go-ole v1.2.6 // indirect - github.com/go-playground/locales v0.14.1 // indirect - github.com/go-playground/universal-translator v0.18.1 // indirect - github.com/go-playground/validator/v10 v10.14.1 // indirect - github.com/go-rod/rod v0.114.0 // indirect - github.com/goburrow/cache v0.1.4 // indirect - github.com/gobwas/httphead v0.1.0 // indirect - github.com/gobwas/pool v0.2.1 // indirect - github.com/gobwas/ws v1.2.1 // indirect - github.com/golang-jwt/jwt/v4 v4.5.0 // indirect - github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/golang/protobuf v1.5.3 // indirect - github.com/golang/snappy v0.0.4 // indirect - github.com/google/certificate-transparency-go v1.1.4 // indirect - github.com/google/go-github v17.0.0+incompatible // indirect - github.com/google/go-github/v30 v30.1.0 // indirect - github.com/google/go-querystring v1.1.0 // indirect - github.com/google/uuid v1.3.1 // indirect - github.com/gorilla/css v1.0.0 // indirect - github.com/h2non/filetype v1.1.3 // indirect - github.com/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/hashicorp/go-retryablehttp v0.7.2 // indirect - github.com/hashicorp/go-version v1.6.0 // indirect - github.com/hashicorp/golang-lru/v2 v2.0.6 // indirect - github.com/hbakhtiyor/strsim v0.0.0-20190107154042-4d2bbb273edf // indirect - github.com/hdm/jarm-go v0.0.7 // indirect - github.com/iancoleman/orderedmap v0.0.0-20190318233801-ac98e3ecb4b0 // indirect - github.com/imdario/mergo v0.3.15 // indirect - github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/itchyny/gojq v0.12.13 // indirect - github.com/itchyny/timefmt-go v0.1.5 // indirect - github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect - github.com/jmespath/go-jmespath v0.4.0 // indirect - github.com/json-iterator/go v1.1.12 // indirect - github.com/kataras/jwt v0.1.8 // indirect - github.com/kevinburke/ssh_config v1.2.0 // indirect - github.com/klauspost/compress v1.16.7 // indirect - github.com/klauspost/cpuid/v2 v2.2.5 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/leodido/go-urn v1.2.4 // indirect - github.com/libdns/libdns v0.2.1 // indirect - github.com/logrusorgru/aurora v2.0.3+incompatible // indirect - github.com/lor00x/goldap v0.0.0-20180618054307-a546dffdd1a3 // indirect - github.com/lucasb-eyer/go-colorful v1.2.0 // indirect - github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect - github.com/mackerelio/go-osstat v0.2.4 // indirect - github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-runewidth v0.0.14 // indirect - github.com/mholt/acmez v1.2.0 // indirect - github.com/mholt/archiver v3.1.1+incompatible // indirect - github.com/microcosm-cc/bluemonday v1.0.25 // indirect - github.com/miekg/dns v1.1.55 // indirect - github.com/minio/selfupdate v0.6.0 // indirect - github.com/mitchellh/go-homedir v1.1.0 // indirect - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/muesli/reflow v0.3.0 // indirect - github.com/muesli/termenv v0.15.1 // indirect - github.com/nwaples/rardecode v1.1.3 // indirect - github.com/olekukonko/tablewriter v0.0.5 // indirect - github.com/pierrec/lz4 v2.6.1+incompatible // indirect - github.com/pjbgf/sha1cd v0.3.0 // indirect - github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect - github.com/pkg/errors v0.9.1 // indirect - github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect - github.com/projectdiscovery/asnmap v1.0.4 // indirect - github.com/projectdiscovery/blackrock v0.0.1 // indirect - github.com/projectdiscovery/cdncheck v1.0.9 // indirect - github.com/projectdiscovery/clistats v0.0.19 // indirect - github.com/projectdiscovery/dsl v0.0.21 // indirect - github.com/projectdiscovery/fastdialer v0.0.37 // indirect - github.com/projectdiscovery/fasttemplate v0.0.2 // indirect - github.com/projectdiscovery/freeport v0.0.5 // indirect - github.com/projectdiscovery/goflags v0.1.20 // indirect - github.com/projectdiscovery/gologger v1.1.11 // indirect - github.com/projectdiscovery/gostruct v0.0.1 // indirect - github.com/projectdiscovery/hmap v0.0.18 // indirect - github.com/projectdiscovery/httpx v1.3.4 // indirect - github.com/projectdiscovery/interactsh v1.1.6 // indirect - github.com/projectdiscovery/mapcidr v1.1.2 // indirect - github.com/projectdiscovery/networkpolicy v0.0.6 // indirect - github.com/projectdiscovery/nuclei/v2 v2.9.15 // indirect - github.com/projectdiscovery/ratelimit v0.0.9 // indirect - github.com/projectdiscovery/rawhttp v0.1.18 // indirect - github.com/projectdiscovery/rdap v0.9.1-0.20221108103045-9865884d1917 // indirect - github.com/projectdiscovery/retryabledns v1.0.35 // indirect - github.com/projectdiscovery/retryablehttp-go v1.0.26 // indirect - github.com/projectdiscovery/sarif v0.0.1 // indirect - github.com/projectdiscovery/tlsx v1.1.4 // indirect - github.com/projectdiscovery/uncover v1.0.6 // indirect - github.com/projectdiscovery/utils v0.0.54 // indirect - github.com/projectdiscovery/wappalyzergo v0.0.109 // indirect - github.com/projectdiscovery/yamldoc-go v1.0.4 // indirect - github.com/quic-go/quic-go v0.38.1 // indirect - github.com/refraction-networking/utls v1.5.2 // indirect - github.com/remeh/sizedwaitgroup v1.0.0 // indirect - github.com/rivo/uniseg v0.4.4 // indirect - github.com/rs/xid v1.5.0 // indirect - github.com/saintfish/chardet v0.0.0-20230101081208-5e3ef4b5456d // indirect - github.com/sashabaranov/go-openai v1.14.2 // indirect - github.com/segmentio/ksuid v1.0.4 // indirect - github.com/sergi/go-diff v1.2.0 // indirect - github.com/shirou/gopsutil/v3 v3.23.7 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect - github.com/skeema/knownhosts v1.1.1 // indirect - github.com/spaolacci/murmur3 v1.1.0 // indirect - github.com/spf13/cast v1.5.1 // indirect - github.com/spf13/pflag v1.0.5 // indirect - github.com/src-d/gcfg v1.4.0 // indirect - github.com/syndtr/goleveldb v1.0.0 // indirect - github.com/tidwall/btree v1.6.0 // indirect - github.com/tidwall/buntdb v1.3.0 // indirect - github.com/tidwall/gjson v1.16.0 // indirect - github.com/tidwall/grect v0.1.4 // indirect - github.com/tidwall/match v1.1.1 // indirect - github.com/tidwall/pretty v1.2.1 // indirect - github.com/tidwall/rtred v0.1.2 // indirect - github.com/tidwall/tinyqueue v0.1.1 // indirect - github.com/tklauser/go-sysconf v0.3.11 // indirect - github.com/tklauser/numcpus v0.6.0 // indirect - github.com/trivago/tgo v1.0.7 // indirect - github.com/ulikunitz/xz v0.5.11 // indirect - github.com/ulule/deepcopier v0.0.0-20200430083143-45decc6639b6 // indirect - github.com/valyala/bytebufferpool v1.0.0 // indirect - github.com/valyala/fasttemplate v1.2.2 // indirect - github.com/weppos/publicsuffix-go v0.30.2-0.20230730094716-a20f9abcc222 // indirect - github.com/xanzy/go-gitlab v0.84.0 // indirect - github.com/xanzy/ssh-agent v0.3.3 // indirect - github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect - github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect - github.com/yl2chen/cidranger v1.0.2 // indirect - github.com/ysmood/fetchup v0.2.3 // indirect - github.com/ysmood/goob v0.4.0 // indirect - github.com/ysmood/got v0.34.1 // indirect - github.com/ysmood/gson v0.7.3 // indirect - github.com/ysmood/leakless v0.8.0 // indirect - github.com/yuin/goldmark v1.5.4 // indirect - github.com/yuin/goldmark-emoji v1.0.1 // indirect - github.com/yusufpapurcu/wmi v1.2.3 // indirect - github.com/zeebo/blake3 v0.2.3 // indirect - github.com/zmap/rc2 v0.0.0-20190804163417-abaa70531248 // indirect - github.com/zmap/zcrypto v0.0.0-20230814193918-dbe676986518 // indirect - go.etcd.io/bbolt v1.3.7 // indirect - go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.25.0 // indirect - goftp.io/server/v2 v2.0.1 // indirect - golang.org/x/crypto v0.28.0 // indirect - golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 // indirect - golang.org/x/mod v0.17.0 // indirect - golang.org/x/net v0.30.0 // indirect - golang.org/x/oauth2 v0.11.0 // indirect - golang.org/x/sys v0.26.0 // indirect - golang.org/x/text v0.19.0 // indirect - golang.org/x/time v0.3.0 // indirect - golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect - google.golang.org/appengine v1.6.7 // indirect - google.golang.org/protobuf v1.31.0 // indirect - gopkg.in/alecthomas/kingpin.v2 v2.2.6 // indirect - gopkg.in/corvus-ch/zbase32.v1 v1.0.0 // indirect - gopkg.in/djherbis/times.v1 v1.3.0 // indirect - gopkg.in/src-d/go-git.v4 v4.13.1 // indirect - gopkg.in/warnings.v0 v0.1.2 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect - moul.io/http2curl v1.0.0 // indirect -) +module fleet + +go 1.23 + +require ( + github.com/gookit/color v1.5.4 + github.com/spf13/cobra v1.8.1 +) + +require ( + aead.dev/minisign v0.2.0 // indirect + git.mills.io/prologic/smtpd v0.0.0-20210710122116-a525b76c287a // indirect + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.1.0 // indirect + github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0 // indirect + github.com/DataDog/gostackparse v0.6.0 // indirect + github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible // indirect + github.com/Masterminds/semver/v3 v3.2.1 // indirect + github.com/Microsoft/go-winio v0.5.2 // indirect + github.com/Mzack9999/gcache v0.0.0-20230410081825-519e28eab057 // indirect + github.com/Mzack9999/go-http-digest-auth-client v0.6.1-0.20220414142836-eb8883508809 // indirect + github.com/Mzack9999/ldapserver v1.0.2-0.20211229000134-b44a0d6ad0dd // indirect + github.com/ProtonMail/go-crypto v0.0.0-20230518184743-7afd39499903 // indirect + github.com/PuerkitoBio/goquery v1.10.0 // indirect + github.com/VividCortex/ewma v1.2.0 // indirect + github.com/acomagu/bufpipe v1.0.4 // indirect + github.com/akrylysov/pogreb v0.10.1 // indirect + github.com/alecthomas/chroma v0.10.0 // indirect + github.com/alecthomas/jsonschema v0.0.0-20211022214203-8b29eab41725 // indirect + github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect + github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect + github.com/andybalholm/brotli v1.0.5 // indirect + github.com/andybalholm/cascadia v1.3.2 // indirect + github.com/andygrunwald/go-jira v1.16.0 // indirect + github.com/antchfx/htmlquery v1.3.0 // indirect + github.com/antchfx/xmlquery v1.3.15 // indirect + github.com/antchfx/xpath v1.2.3 // indirect + github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect + github.com/aws/aws-sdk-go-v2 v1.19.0 // indirect + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.10 // indirect + github.com/aws/aws-sdk-go-v2/config v1.18.28 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.13.27 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.5 // indirect + github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.72 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.35 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.29 // indirect + github.com/aws/aws-sdk-go-v2/internal/ini v1.3.36 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.27 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.11 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.30 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.29 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.14.4 // indirect + github.com/aws/aws-sdk-go-v2/service/s3 v1.37.0 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.12.13 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.13 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.19.3 // indirect + github.com/aws/smithy-go v1.13.5 // indirect + github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect + github.com/aymerick/douceur v0.2.0 // indirect + github.com/bits-and-blooms/bitset v1.8.0 // indirect + github.com/bits-and-blooms/bloom/v3 v3.5.0 // indirect + github.com/bluele/gcache v0.0.2 // indirect + github.com/caddyserver/certmagic v0.19.2 // indirect + github.com/charmbracelet/glamour v0.6.0 // indirect + github.com/cheggaaa/pb/v3 v3.1.4 // indirect + github.com/cloudflare/cfssl v1.6.4 // indirect + github.com/cloudflare/circl v1.3.3 // indirect + github.com/cnf/structhash v0.0.0-20201127153200-e1b16c1ebc08 // indirect + github.com/corpix/uarand v0.2.0 // indirect + github.com/dimchansky/utfbom v1.1.1 // indirect + github.com/dlclark/regexp2 v1.8.1 // indirect + github.com/docker/go-units v0.5.0 // indirect + github.com/dsnet/compress v0.0.1 // indirect + github.com/emirpasic/gods v1.18.1 // indirect + github.com/fatih/color v1.18.0 // indirect + github.com/fatih/structs v1.1.0 // indirect + github.com/gabriel-vasile/mimetype v1.4.2 // indirect + github.com/gaukas/godicttls v0.0.4 // indirect + github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect + github.com/go-git/go-billy/v5 v5.4.1 // indirect + github.com/go-git/go-git/v5 v5.7.0 // indirect + github.com/go-ole/go-ole v1.2.6 // indirect + github.com/go-playground/locales v0.14.1 // indirect + github.com/go-playground/universal-translator v0.18.1 // indirect + github.com/go-playground/validator/v10 v10.14.1 // indirect + github.com/go-rod/rod v0.114.0 // indirect + github.com/goburrow/cache v0.1.4 // indirect + github.com/gobwas/httphead v0.1.0 // indirect + github.com/gobwas/pool v0.2.1 // indirect + github.com/gobwas/ws v1.2.1 // indirect + github.com/golang-jwt/jwt/v4 v4.5.0 // indirect + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect + github.com/golang/protobuf v1.5.3 // indirect + github.com/golang/snappy v0.0.4 // indirect + github.com/google/certificate-transparency-go v1.1.4 // indirect + github.com/google/go-github v17.0.0+incompatible // indirect + github.com/google/go-github/v30 v30.1.0 // indirect + github.com/google/go-querystring v1.1.0 // indirect + github.com/google/uuid v1.3.1 // indirect + github.com/gorilla/css v1.0.0 // indirect + github.com/h2non/filetype v1.1.3 // indirect + github.com/hashicorp/go-cleanhttp v0.5.2 // indirect + github.com/hashicorp/go-retryablehttp v0.7.2 // indirect + github.com/hashicorp/go-version v1.6.0 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.6 // indirect + github.com/hbakhtiyor/strsim v0.0.0-20190107154042-4d2bbb273edf // indirect + github.com/hdm/jarm-go v0.0.7 // indirect + github.com/iancoleman/orderedmap v0.0.0-20190318233801-ac98e3ecb4b0 // indirect + github.com/imdario/mergo v0.3.15 // indirect + github.com/inconshreveable/mousetrap v1.1.0 // indirect + github.com/itchyny/gojq v0.12.13 // indirect + github.com/itchyny/timefmt-go v0.1.5 // indirect + github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect + github.com/jmespath/go-jmespath v0.4.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/kataras/jwt v0.1.8 // indirect + github.com/kevinburke/ssh_config v1.2.0 // indirect + github.com/klauspost/compress v1.16.7 // indirect + github.com/klauspost/cpuid/v2 v2.2.5 // indirect + github.com/kylelemons/godebug v1.1.0 // indirect + github.com/leodido/go-urn v1.2.4 // indirect + github.com/libdns/libdns v0.2.1 // indirect + github.com/logrusorgru/aurora v2.0.3+incompatible // indirect + github.com/lor00x/goldap v0.0.0-20180618054307-a546dffdd1a3 // indirect + github.com/lucasb-eyer/go-colorful v1.2.0 // indirect + github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect + github.com/mackerelio/go-osstat v0.2.4 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/mattn/go-runewidth v0.0.14 // indirect + github.com/mholt/acmez v1.2.0 // indirect + github.com/mholt/archiver v3.1.1+incompatible // indirect + github.com/microcosm-cc/bluemonday v1.0.25 // indirect + github.com/miekg/dns v1.1.55 // indirect + github.com/minio/selfupdate v0.6.0 // indirect + github.com/mitchellh/go-homedir v1.1.0 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/muesli/reflow v0.3.0 // indirect + github.com/muesli/termenv v0.15.1 // indirect + github.com/nwaples/rardecode v1.1.3 // indirect + github.com/olekukonko/tablewriter v0.0.5 // indirect + github.com/pierrec/lz4 v2.6.1+incompatible // indirect + github.com/pjbgf/sha1cd v0.3.0 // indirect + github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect + github.com/projectdiscovery/asnmap v1.0.4 // indirect + github.com/projectdiscovery/blackrock v0.0.1 // indirect + github.com/projectdiscovery/cdncheck v1.0.9 // indirect + github.com/projectdiscovery/clistats v0.0.19 // indirect + github.com/projectdiscovery/dsl v0.0.21 // indirect + github.com/projectdiscovery/fastdialer v0.0.37 // indirect + github.com/projectdiscovery/fasttemplate v0.0.2 // indirect + github.com/projectdiscovery/freeport v0.0.5 // indirect + github.com/projectdiscovery/goflags v0.1.20 // indirect + github.com/projectdiscovery/gologger v1.1.11 // indirect + github.com/projectdiscovery/gostruct v0.0.1 // indirect + github.com/projectdiscovery/hmap v0.0.18 // indirect + github.com/projectdiscovery/httpx v1.3.4 // indirect + github.com/projectdiscovery/interactsh v1.1.6 // indirect + github.com/projectdiscovery/mapcidr v1.1.2 // indirect + github.com/projectdiscovery/networkpolicy v0.0.6 // indirect + github.com/projectdiscovery/nuclei/v2 v2.9.15 // indirect + github.com/projectdiscovery/ratelimit v0.0.9 // indirect + github.com/projectdiscovery/rawhttp v0.1.18 // indirect + github.com/projectdiscovery/rdap v0.9.1-0.20221108103045-9865884d1917 // indirect + github.com/projectdiscovery/retryabledns v1.0.35 // indirect + github.com/projectdiscovery/retryablehttp-go v1.0.26 // indirect + github.com/projectdiscovery/sarif v0.0.1 // indirect + github.com/projectdiscovery/tlsx v1.1.4 // indirect + github.com/projectdiscovery/uncover v1.0.6 // indirect + github.com/projectdiscovery/utils v0.0.54 // indirect + github.com/projectdiscovery/wappalyzergo v0.0.109 // indirect + github.com/projectdiscovery/yamldoc-go v1.0.4 // indirect + github.com/quic-go/quic-go v0.38.1 // indirect + github.com/refraction-networking/utls v1.5.2 // indirect + github.com/remeh/sizedwaitgroup v1.0.0 // indirect + github.com/rivo/uniseg v0.4.4 // indirect + github.com/rs/xid v1.5.0 // indirect + github.com/saintfish/chardet v0.0.0-20230101081208-5e3ef4b5456d // indirect + github.com/sashabaranov/go-openai v1.14.2 // indirect + github.com/segmentio/ksuid v1.0.4 // indirect + github.com/sergi/go-diff v1.2.0 // indirect + github.com/shirou/gopsutil/v3 v3.23.7 // indirect + github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/skeema/knownhosts v1.1.1 // indirect + github.com/spaolacci/murmur3 v1.1.0 // indirect + github.com/spf13/cast v1.5.1 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/src-d/gcfg v1.4.0 // indirect + github.com/syndtr/goleveldb v1.0.0 // indirect + github.com/tidwall/btree v1.6.0 // indirect + github.com/tidwall/buntdb v1.3.0 // indirect + github.com/tidwall/gjson v1.16.0 // indirect + github.com/tidwall/grect v0.1.4 // indirect + github.com/tidwall/match v1.1.1 // indirect + github.com/tidwall/pretty v1.2.1 // indirect + github.com/tidwall/rtred v0.1.2 // indirect + github.com/tidwall/tinyqueue v0.1.1 // indirect + github.com/tklauser/go-sysconf v0.3.11 // indirect + github.com/tklauser/numcpus v0.6.0 // indirect + github.com/trivago/tgo v1.0.7 // indirect + github.com/ulikunitz/xz v0.5.11 // indirect + github.com/ulule/deepcopier v0.0.0-20200430083143-45decc6639b6 // indirect + github.com/valyala/bytebufferpool v1.0.0 // indirect + github.com/valyala/fasttemplate v1.2.2 // indirect + github.com/weppos/publicsuffix-go v0.30.2-0.20230730094716-a20f9abcc222 // indirect + github.com/xanzy/go-gitlab v0.84.0 // indirect + github.com/xanzy/ssh-agent v0.3.3 // indirect + github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect + github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect + github.com/yl2chen/cidranger v1.0.2 // indirect + github.com/ysmood/fetchup v0.2.3 // indirect + github.com/ysmood/goob v0.4.0 // indirect + github.com/ysmood/got v0.34.1 // indirect + github.com/ysmood/gson v0.7.3 // indirect + github.com/ysmood/leakless v0.8.0 // indirect + github.com/yuin/goldmark v1.5.4 // indirect + github.com/yuin/goldmark-emoji v1.0.1 // indirect + github.com/yusufpapurcu/wmi v1.2.3 // indirect + github.com/zeebo/blake3 v0.2.3 // indirect + github.com/zmap/rc2 v0.0.0-20190804163417-abaa70531248 // indirect + github.com/zmap/zcrypto v0.0.0-20230814193918-dbe676986518 // indirect + go.etcd.io/bbolt v1.3.7 // indirect + go.uber.org/multierr v1.11.0 // indirect + go.uber.org/zap v1.25.0 // indirect + goftp.io/server/v2 v2.0.1 // indirect + golang.org/x/crypto v0.28.0 // indirect + golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 // indirect + golang.org/x/mod v0.17.0 // indirect + golang.org/x/net v0.30.0 // indirect + golang.org/x/oauth2 v0.11.0 // indirect + golang.org/x/sys v0.26.0 // indirect + golang.org/x/text v0.19.0 // indirect + golang.org/x/time v0.3.0 // indirect + golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect + google.golang.org/appengine v1.6.7 // indirect + google.golang.org/protobuf v1.31.0 // indirect + gopkg.in/alecthomas/kingpin.v2 v2.2.6 // indirect + gopkg.in/corvus-ch/zbase32.v1 v1.0.0 // indirect + gopkg.in/djherbis/times.v1 v1.3.0 // indirect + gopkg.in/src-d/go-git.v4 v4.13.1 // indirect + gopkg.in/warnings.v0 v0.1.2 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect + moul.io/http2curl v1.0.0 // indirect +) diff --git a/go.sum b/go.sum index 2d9e25ef..8b70bbda 100644 --- a/go.sum +++ b/go.sum @@ -156,6 +156,8 @@ github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI= +github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= +github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= @@ -676,6 +678,7 @@ golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= diff --git a/handlers/install.go b/handlers/install.go index 151484d4..03272f86 100644 --- a/handlers/install.go +++ b/handlers/install.go @@ -23,16 +23,15 @@ import ( var ( boldGreen = color.New(color.FgGreen, color.Bold) redBold = color.New(color.FgRed, color.Bold) - green = color.New(color.FgGreen) yellow = color.New(color.FgYellow) yellowItalic = color.New(color.FgYellow, color.BgBlack, color.Italic) ) func Install(pkg string) { - yellowItalic.Println("Esto puede tardar un rato... 😴") + yellowItalic.Println("This may take a while... 😴") installFunc, exists := lib.GetTool(pkg) if !exists { - redBold.Printf("Error: El paquete %s no es reconocido.\n", pkg) + redBold.Printf("Error: Package %s is not recognized.\n", pkg) return } diff --git a/handlers/uninstall.go b/handlers/uninstall.go index 21e5674b..c5440786 100644 --- a/handlers/uninstall.go +++ b/handlers/uninstall.go @@ -21,9 +21,9 @@ import ( func Uninstall(pkg string) { p := "/usr/local/bin/" + pkg if err := os.Remove(p); err != nil { - redBold.Println("Error eliminando el binario:", err) + redBold.Println("Error deleting the binary:", err) return } - boldGreen.Println(pkg + " Eliminado correctamente. 🎉") + boldGreen.Println(pkg + " Successfully removed. 🎉") } diff --git a/handlers/update.go b/handlers/update.go deleted file mode 100644 index d91f8ca9..00000000 --- a/handlers/update.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (C) 2024 Fleet Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package handlers diff --git a/handlers/version.go b/handlers/version.go index 728ff510..f6bd6b65 100644 --- a/handlers/version.go +++ b/handlers/version.go @@ -15,5 +15,5 @@ package handlers func ShowVersion() { - yellow.Println("Fleet version 1.0.0") + yellow.Println("Fleet Version 1.1.3") } diff --git a/lib/structTool.go b/lib/structTool.go index d45d17e9..7b9dc515 100644 --- a/lib/structTool.go +++ b/lib/structTool.go @@ -14,7 +14,7 @@ package lib -import "LattePkg/formulas" +import "fleet/formulas" type Tool struct { Name string @@ -103,9 +103,9 @@ var tools = []Tool{ Install: formulas.InstallBazel, Version: "7.0.0", }, - { - Name: "bat", - Install: formulas.InstallBat, - Version: "0.24.0", - }, + { + Name: "bat", + Install: formulas.InstallBat, + Version: "0.24.0", + }, } diff --git a/lib/versionFlag.go b/lib/versionFlag.go index 5883977c..dde4098a 100644 --- a/lib/versionFlag.go +++ b/lib/versionFlag.go @@ -1,24 +1,27 @@ -// Copyright (C) 2024 Fleet Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - +// Copyright (C) 2024 Fleet Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// package formulas + + package lib -func versionFlag(toolName string) string { +func VersionFlag(toolName string) string { // Exportada for _, tool := range tools { if tool.Name == toolName { return tool.Version } } - return versionFlag(toolName) + return "" // Evitar el bucle infinito anterior } diff --git a/main.go b/main.go index dbf3d979..923ec686 100644 --- a/main.go +++ b/main.go @@ -14,9 +14,10 @@ package main -import cli "fleet/cli" +import "fleet/cli" func main() { - cli.Command().Execute() - + if err := cli.Command().Execute(); err != nil { + panic(err) + } } diff --git a/scripts/add_license.sh b/scripts/add_license.sh index c0466119..d753a55e 100755 --- a/scripts/add_license.sh +++ b/scripts/add_license.sh @@ -1,28 +1,27 @@ -#!/bin/bash - -LICENSE="// Copyright (C) 2024 Fleet Inc. -// -// Licensed under the Apache License, Version 2.0 (the \"License\"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an \"AS IS\" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package formulas -" - -# Recorrer carpetas específicas: CLI, Formulas, handlers -for file in $(find ./cli ./formulas ./handlers ./lib -name "*.go"); do - if ! grep -q "Copyright (C) 2024 Fleet Inc." "$file"; then - echo -e "$LICENSE\n\n$(cat $file)" > $file - echo "Licencia añadida a $file" - else - echo "Licencia ya existe en $file" - fi -done +#!/bin/bash + +LICENSE="// Copyright (C) 2024 Fleet Inc. +// +// Licensed under the Apache License, Version 2.0 (the \"License\"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an \"AS IS\" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// package formulas +" + +for file in $(find ./cli ./formulas ./handlers ./lib -name "*.go"); do + if ! grep -q "Copyright (C) 2024 Fleet Inc." "$file"; then + echo -e "$LICENSE\n\n$(cat "$file")" >"$file" + echo "Licencia añadida a $file" + else + echo "Licencia ya existe en $file" + fi +done