diff --git a/.github/dependabot.yml b/.github/dependabot.yml index d0ad1de..605744a 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -6,7 +6,7 @@ updates: target-branch: "develop" schedule: interval: "daily" - timezone: "Europe/London" + timezone: "Etc/UTC" time: "03:00" labels: - "PR • MAINTENANCE" @@ -26,8 +26,8 @@ updates: target-branch: "develop" schedule: interval: "daily" - timezone: "Europe/London" - time: "04:00" + timezone: "Etc/UTC" + time: "03:00" labels: - "PR • MAINTENANCE" assignees: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 411bcc3..39e3b03 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,7 +29,7 @@ jobs: strategy: matrix: - go: [ '1.21.x', '1.22.x' ] + go: [ '1.22.x', '1.23.x' ] steps: - name: Checkout diff --git a/Makefile b/Makefile index bf7821f..2f6fd31 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ ################################################################################ -# This Makefile generated by GoMakeGen 3.0.2 using next command: +# This Makefile generated by GoMakeGen 3.2.0 using next command: # gomakegen --mod . # # More info: https://kaos.sh/gomakegen @@ -11,6 +11,16 @@ ifdef VERBOSE ## Print verbose information (Flag) VERBOSE_FLAG = -v endif +ifdef PROXY ## Force proxy usage for downloading dependencies (Flag) +export GOPROXY=https://proxy.golang.org/cached-only,direct +endif + +ifdef CGO ## Enable CGO usage (Flag) +export CGO_ENABLED=1 +else +export CGO_ENABLED=0 +endif + COMPAT ?= 1.19 MAKEDIR = $(dir $(realpath $(firstword $(MAKEFILE_LIST)))) GITREV ?= $(shell test -s $(MAKEDIR)/.git && git rev-parse --short HEAD) @@ -107,8 +117,9 @@ help: ## Show this info @echo -e '\n\033[1mVariables:\033[0m\n' @grep -E '^ifdef [A-Z_]+ .*?## .*$$' $(abspath $(lastword $(MAKEFILE_LIST))) \ | sed 's/ifdef //' \ + | sort -h \ | awk 'BEGIN {FS = " .*?## "}; {printf " \033[32m%-11s\033[0m %s\n", $$1, $$2}' @echo -e '' - @echo -e '\033[90mGenerated by GoMakeGen 3.0.2\033[0m\n' + @echo -e '\033[90mGenerated by GoMakeGen 3.2.0\033[0m\n' ################################################################################ diff --git a/app/app.go b/app/app.go index 8870528..5dbfec8 100644 --- a/app/app.go +++ b/app/app.go @@ -11,25 +11,24 @@ import ( "fmt" "os" - "github.com/essentialkaos/ek/v12/fmtc" - "github.com/essentialkaos/ek/v12/fmtutil" - "github.com/essentialkaos/ek/v12/options" - "github.com/essentialkaos/ek/v12/req" - "github.com/essentialkaos/ek/v12/spinner" - "github.com/essentialkaos/ek/v12/strutil" - "github.com/essentialkaos/ek/v12/support" - "github.com/essentialkaos/ek/v12/support/deps" - "github.com/essentialkaos/ek/v12/terminal" - "github.com/essentialkaos/ek/v12/terminal/input" - "github.com/essentialkaos/ek/v12/terminal/tty" - "github.com/essentialkaos/ek/v12/timeutil" - "github.com/essentialkaos/ek/v12/tmp" - "github.com/essentialkaos/ek/v12/usage" - "github.com/essentialkaos/ek/v12/usage/completion/bash" - "github.com/essentialkaos/ek/v12/usage/completion/fish" - "github.com/essentialkaos/ek/v12/usage/completion/zsh" - "github.com/essentialkaos/ek/v12/usage/man" - "github.com/essentialkaos/ek/v12/usage/update" + "github.com/essentialkaos/ek/v13/fmtc" + "github.com/essentialkaos/ek/v13/fmtutil" + "github.com/essentialkaos/ek/v13/options" + "github.com/essentialkaos/ek/v13/req" + "github.com/essentialkaos/ek/v13/spinner" + "github.com/essentialkaos/ek/v13/strutil" + "github.com/essentialkaos/ek/v13/support" + "github.com/essentialkaos/ek/v13/support/deps" + "github.com/essentialkaos/ek/v13/terminal" + "github.com/essentialkaos/ek/v13/terminal/tty" + "github.com/essentialkaos/ek/v13/timeutil" + "github.com/essentialkaos/ek/v13/tmp" + "github.com/essentialkaos/ek/v13/usage" + "github.com/essentialkaos/ek/v13/usage/completion/bash" + "github.com/essentialkaos/ek/v13/usage/completion/fish" + "github.com/essentialkaos/ek/v13/usage/completion/zsh" + "github.com/essentialkaos/ek/v13/usage/man" + "github.com/essentialkaos/ek/v13/usage/update" "github.com/essentialkaos/artefactor/github" ) @@ -39,7 +38,7 @@ import ( // Basic application info const ( APP = "artefactor" - VER = "0.5.1" + VER = "0.6.0" DESC = "Utility for downloading artefacts from GitHub" ) @@ -151,11 +150,6 @@ func preConfigureUI() { fmtc.DisableColors = true } - input.TitleColorTag = "{s}{&}" - input.Prompt = "{s}›{!} " - input.MaskSymbol = "•" - input.MaskSymbolColorTag = "{s-}" - switch { case fmtc.Is256ColorsSupported(): colorTagApp, colorTagVer = "{*}{#117}", "{#117}" diff --git a/app/cmd_cleanup.go b/app/cmd_cleanup.go index 381e998..a1153ff 100644 --- a/app/cmd_cleanup.go +++ b/app/cmd_cleanup.go @@ -13,12 +13,11 @@ import ( "path" "strings" - "github.com/essentialkaos/ek/v12/fmtc" - "github.com/essentialkaos/ek/v12/mathutil" - "github.com/essentialkaos/ek/v12/options" - "github.com/essentialkaos/ek/v12/spinner" - "github.com/essentialkaos/ek/v12/terminal" - "github.com/essentialkaos/ek/v12/terminal/input" + "github.com/essentialkaos/ek/v13/fmtc" + "github.com/essentialkaos/ek/v13/mathutil" + "github.com/essentialkaos/ek/v13/options" + "github.com/essentialkaos/ek/v13/spinner" + "github.com/essentialkaos/ek/v13/terminal" "github.com/essentialkaos/artefactor/data" ) @@ -59,16 +58,6 @@ func cmdCleanup(args options.Arguments) error { return nil } - ok, _ := input.ReadAnswer( - fmt.Sprintf("Remove old versions except the last %d?", keepVersions), "N", - ) - - if !ok { - return nil - } - - fmtc.NewLine() - err = cleanupVersions(index, dataDir, keepVersions) if err != nil { @@ -91,9 +80,11 @@ func cleanupVersions(index *data.Index, dataDir string, keepVersions int) error return nil } + fmtc.NewLine() + for name, versions := range allVersions { - fmtc.Printf(" {s-}-{!} {*}%s{!}{s}:{!} ", name) - fmtc.Print(strings.Join(versions, "{s},{!} ")) + fmtc.Printf(" {s-}•{!} {*}%s{!}{s}:{!} ", name) + fmtc.Print(strings.Join(versions, "{s-},{!} ")) fmtc.NewLine() versionNum += len(versions) @@ -101,16 +92,6 @@ func cleanupVersions(index *data.Index, dataDir string, keepVersions int) error fmtc.NewLine() - ok, _ := input.ReadAnswer( - fmt.Sprintf("Remove these versions (%d)?", versionNum), "N", - ) - - if !ok { - return nil - } - - fmtc.NewLine() - var currentVersion int spinner.Show("Removing outdated versions") @@ -133,6 +114,8 @@ func cleanupVersions(index *data.Index, dataDir string, keepVersions int) error spinner.Update("{s}[%d/%d]{!} Remove outdated versions", currentVersion, versionNum) spinner.Done(true) + fmtc.NewLine() + return nil } diff --git a/app/cmd_download.go b/app/cmd_download.go index c1f46c9..cd60149 100644 --- a/app/cmd_download.go +++ b/app/cmd_download.go @@ -14,16 +14,16 @@ import ( "os" "strings" - "github.com/essentialkaos/ek/v12/fmtc" - "github.com/essentialkaos/ek/v12/fmtutil" - "github.com/essentialkaos/ek/v12/fsutil" - "github.com/essentialkaos/ek/v12/httputil" - "github.com/essentialkaos/ek/v12/options" - "github.com/essentialkaos/ek/v12/path" - "github.com/essentialkaos/ek/v12/req" - "github.com/essentialkaos/ek/v12/spinner" - "github.com/essentialkaos/ek/v12/strutil" - "github.com/essentialkaos/ek/v12/timeutil" + "github.com/essentialkaos/ek/v13/fmtc" + "github.com/essentialkaos/ek/v13/fmtutil" + "github.com/essentialkaos/ek/v13/fsutil" + "github.com/essentialkaos/ek/v13/httputil" + "github.com/essentialkaos/ek/v13/options" + "github.com/essentialkaos/ek/v13/path" + "github.com/essentialkaos/ek/v13/req" + "github.com/essentialkaos/ek/v13/spinner" + "github.com/essentialkaos/ek/v13/strutil" + "github.com/essentialkaos/ek/v13/timeutil" "github.com/essentialkaos/npck" diff --git a/app/cmd_get.go b/app/cmd_get.go index b6b8819..117e27d 100644 --- a/app/cmd_get.go +++ b/app/cmd_get.go @@ -13,14 +13,14 @@ import ( "os" "strings" - "github.com/essentialkaos/ek/v12/fmtc" - "github.com/essentialkaos/ek/v12/fsutil" - "github.com/essentialkaos/ek/v12/options" - "github.com/essentialkaos/ek/v12/path" - "github.com/essentialkaos/ek/v12/progress" - "github.com/essentialkaos/ek/v12/req" - "github.com/essentialkaos/ek/v12/system" - "github.com/essentialkaos/ek/v12/terminal" + "github.com/essentialkaos/ek/v13/fmtc" + "github.com/essentialkaos/ek/v13/fsutil" + "github.com/essentialkaos/ek/v13/options" + "github.com/essentialkaos/ek/v13/path" + "github.com/essentialkaos/ek/v13/progress" + "github.com/essentialkaos/ek/v13/req" + "github.com/essentialkaos/ek/v13/system" + "github.com/essentialkaos/ek/v13/terminal" "github.com/essentialkaos/artefactor/data" ) diff --git a/app/cmd_list.go b/app/cmd_list.go index 1ebd0db..e057284 100644 --- a/app/cmd_list.go +++ b/app/cmd_list.go @@ -11,16 +11,16 @@ import ( "fmt" "strings" - "github.com/essentialkaos/ek/v12/fmtc" - "github.com/essentialkaos/ek/v12/fmtutil" - "github.com/essentialkaos/ek/v12/fsutil" - "github.com/essentialkaos/ek/v12/jsonutil" - "github.com/essentialkaos/ek/v12/options" - "github.com/essentialkaos/ek/v12/pager" - "github.com/essentialkaos/ek/v12/path" - "github.com/essentialkaos/ek/v12/req" - "github.com/essentialkaos/ek/v12/terminal" - "github.com/essentialkaos/ek/v12/terminal/tty" + "github.com/essentialkaos/ek/v13/fmtc" + "github.com/essentialkaos/ek/v13/fmtutil" + "github.com/essentialkaos/ek/v13/fsutil" + "github.com/essentialkaos/ek/v13/jsonutil" + "github.com/essentialkaos/ek/v13/options" + "github.com/essentialkaos/ek/v13/pager" + "github.com/essentialkaos/ek/v13/path" + "github.com/essentialkaos/ek/v13/req" + "github.com/essentialkaos/ek/v13/terminal" + "github.com/essentialkaos/ek/v13/terminal/tty" "github.com/essentialkaos/artefactor/data" ) diff --git a/common/artefactor.spec b/common/artefactor.spec index 9cd2e16..f1061d5 100644 --- a/common/artefactor.spec +++ b/common/artefactor.spec @@ -14,7 +14,7 @@ Summary: Utility for downloading artefacts from GitHub Name: artefactor -Version: 0.5.1 +Version: 0.6.0 Release: 0%{?dist} Group: Applications/System License: Apache License, Version 2.0 @@ -26,7 +26,7 @@ Source100: checksum.sha512 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -BuildRequires: golang >= 1.22 +BuildRequires: golang >= 1.21 Provides: %{name} = %{version}-%{release} @@ -127,6 +127,10 @@ fi ################################################################################ %changelog +* Wed Sep 11 2024 Anton Novojilov - 0.6.0-0 +- Migrate to v13 version of ek package +- Code refactoring + * Mon Jun 17 2024 Anton Novojilov - 0.5.1-0 - Dependencies update diff --git a/common/artefacts.yml b/common/artefacts.yml index f6bbd75..96d4a42 100644 --- a/common/artefacts.yml +++ b/common/artefacts.yml @@ -35,6 +35,12 @@ file: "duf" output: "duf-x86_64" +- name: eza + repo: eza-community/eza + source: "eza_x86_64-unknown-linux-gnu.tar.gz" + file: "eza" + output: "eza-x86_64" + - name: fzf repo: junegunn/fzf source: "*-linux_amd64.tar.gz" diff --git a/data/index.go b/data/index.go index 6467629..ef8ff45 100644 --- a/data/index.go +++ b/data/index.go @@ -12,10 +12,10 @@ import ( "os" "strings" - "github.com/essentialkaos/ek/v12/fsutil" - "github.com/essentialkaos/ek/v12/jsonutil" - "github.com/essentialkaos/ek/v12/path" - "github.com/essentialkaos/ek/v12/sortutil" + "github.com/essentialkaos/ek/v13/fsutil" + "github.com/essentialkaos/ek/v13/jsonutil" + "github.com/essentialkaos/ek/v13/path" + "github.com/essentialkaos/ek/v13/sortutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/github/github.go b/github/github.go index fde63c7..74ee625 100644 --- a/github/github.go +++ b/github/github.go @@ -13,8 +13,8 @@ import ( "strings" "time" - "github.com/essentialkaos/ek/v12/req" - "github.com/essentialkaos/ek/v12/timeutil" + "github.com/essentialkaos/ek/v13/req" + "github.com/essentialkaos/ek/v13/timeutil" ) // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/go.mod b/go.mod index a548b5f..24ab6e5 100644 --- a/go.mod +++ b/go.mod @@ -1,19 +1,19 @@ module github.com/essentialkaos/artefactor -go 1.18 +go 1.21 require ( - github.com/essentialkaos/ek/v12 v12.126.1 - github.com/essentialkaos/go-simpleyaml/v2 v2.1.4 + github.com/essentialkaos/ek/v13 v13.4.0 + github.com/essentialkaos/go-simpleyaml/v2 v2.1.5 github.com/essentialkaos/npck v1.6.3 ) require ( github.com/essentialkaos/depsy v1.3.0 // indirect - github.com/essentialkaos/go-linenoise/v3 v3.6.0 // indirect + github.com/essentialkaos/ek/v12 v12.130.0 // indirect github.com/klauspost/compress v1.17.9 // indirect github.com/pierrec/lz4/v4 v4.1.21 // indirect github.com/ulikunitz/xz v0.5.12 // indirect - golang.org/x/sys v0.21.0 // indirect + golang.org/x/sys v0.25.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect ) diff --git a/go.sum b/go.sum index 4358c41..cdf12f9 100644 --- a/go.sum +++ b/go.sum @@ -1,25 +1,29 @@ github.com/essentialkaos/check v1.4.0 h1:kWdFxu9odCxUqo1NNFNJmguGrDHgwi3A8daXX1nkuKk= +github.com/essentialkaos/check v1.4.0/go.mod h1:LMKPZ2H+9PXe7Y2gEoKyVAwUqXVgx7KtgibfsHJPus0= github.com/essentialkaos/depsy v1.3.0 h1:CN7bRgBU2jGTHSkg/Sh38eDUn7cvmaTp2sxFt2HpFeU= github.com/essentialkaos/depsy v1.3.0/go.mod h1:kpiTAV17dyByVnrbNaMcZt2jRwvuXClUYOzpyJQwtG8= -github.com/essentialkaos/ek/v12 v12.126.1 h1:K4tCpu9T3k5Bv6hJ1lmW7Ou0GxjgjBIKRsoZgAGdEhE= -github.com/essentialkaos/ek/v12 v12.126.1/go.mod h1:71IJ7m82hgjrvWnhL+z0vIhguxz47/rfVma5/CeI5Fw= -github.com/essentialkaos/go-linenoise/v3 v3.6.0 h1:deLcrodtLIkcHjNyW/MoQpjznXPVqvwlspxk7s/5YeY= -github.com/essentialkaos/go-linenoise/v3 v3.6.0/go.mod h1:Fi6kLdZdURkXHpRkIiX2nFGORNv81CXTZ2Mn72i/cn0= -github.com/essentialkaos/go-simpleyaml/v2 v2.1.4 h1:B2bXdGWaQ6Xy3HTsO2DLBoNV7cbMW3KDmeeOKYLo9z0= -github.com/essentialkaos/go-simpleyaml/v2 v2.1.4/go.mod h1:pVQTleUBC8xBI9+HnTF38xWBZqANNrmMAzwmUemblJg= +github.com/essentialkaos/ek/v12 v12.130.0 h1:JhcjGZaBIEFfyNReHAHeTgldNv65ruHa9LR7YIVgmn0= +github.com/essentialkaos/ek/v12 v12.130.0/go.mod h1:yGof+LJIkWvQtGINs+2AGv/yeqcfj/brpQ9eYnzMzKs= +github.com/essentialkaos/ek/v13 v13.4.0 h1:1yKDXJJ4LN8+5vHXWqHITsBkTEB4+Jy5CDiy9LzbT3E= +github.com/essentialkaos/ek/v13 v13.4.0/go.mod h1:KBOtJlrIC2etc/EXvMdbz1JeKmtkuVdK6uRW/ap0OPM= +github.com/essentialkaos/go-simpleyaml/v2 v2.1.5 h1:HrFk4JhgBT5pzEkwFW4MqdgsAW4KN7/Um6rTHq1GTJk= +github.com/essentialkaos/go-simpleyaml/v2 v2.1.5/go.mod h1:m3Ub1npzYSZTgSzW68wUT1ak7p9hOSFvTnyhtwKlvSA= github.com/essentialkaos/npck v1.6.3 h1:isUq6nkPuL6/PD8lcN1lvFmJEDP8smeGhINmkTFG1Ho= github.com/essentialkaos/npck v1.6.3/go.mod h1:ZQOPKznWzmoq1mMU2jWfJTbJ418P49hNlM/U1K+b0V0= github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ= github.com/pierrec/lz4/v4 v4.1.21/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/ulikunitz/xz v0.5.12 h1:37Nm15o69RwBkXM0J6A5OlE67RZTfzUxTj8fB3dfcsc= github.com/ulikunitz/xz v0.5.12/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= +golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=