Skip to content

Commit

Permalink
Merge pull request #83 from essentialkaos/develop
Browse files Browse the repository at this point in the history
Version 0.6.0
  • Loading branch information
andyone authored Sep 13, 2024
2 parents e07e191 + 2eadd04 commit db1bb4c
Show file tree
Hide file tree
Showing 14 changed files with 110 additions and 108 deletions.
6 changes: 3 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ updates:
target-branch: "develop"
schedule:
interval: "daily"
timezone: "Europe/London"
timezone: "Etc/UTC"
time: "03:00"
labels:
- "PR • MAINTENANCE"
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:

strategy:
matrix:
go: [ '1.21.x', '1.22.x' ]
go: [ '1.22.x', '1.23.x' ]

steps:
- name: Checkout
Expand Down
15 changes: 13 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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'

################################################################################
44 changes: 19 additions & 25 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -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"
)

Expand Down Expand Up @@ -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}"
Expand Down
39 changes: 11 additions & 28 deletions app/cmd_cleanup.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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 {
Expand All @@ -91,26 +80,18 @@ 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)
}

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")
Expand All @@ -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
}

Expand Down
20 changes: 10 additions & 10 deletions app/cmd_download.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
16 changes: 8 additions & 8 deletions app/cmd_get.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
20 changes: 10 additions & 10 deletions app/cmd_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
8 changes: 6 additions & 2 deletions common/artefactor.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}

Expand Down Expand Up @@ -127,6 +127,10 @@ fi
################################################################################

%changelog
* Wed Sep 11 2024 Anton Novojilov <andy@essentialkaos.com> - 0.6.0-0
- Migrate to v13 version of ek package
- Code refactoring

* Mon Jun 17 2024 Anton Novojilov <andy@essentialkaos.com> - 0.5.1-0
- Dependencies update

Expand Down
6 changes: 6 additions & 0 deletions common/artefacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 4 additions & 4 deletions data/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down
4 changes: 2 additions & 2 deletions github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -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
)
Loading

0 comments on commit db1bb4c

Please sign in to comment.