From b8d42e6cab4080379c132b3f7b06a68b33d1ec7f Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Thu, 10 Oct 2024 13:31:17 +0300 Subject: [PATCH 01/15] Regenerate Makefile with the latest version of gomakegen --- Makefile | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 1702d3e..335ac81 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.1 using next command: # gomakegen --mod . # # More info: https://kaos.sh/gomakegen @@ -11,7 +11,16 @@ ifdef VERBOSE ## Print verbose information (Flag) VERBOSE_FLAG = -v endif -COMPAT ?= 1.19 +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 + MAKEDIR = $(dir $(realpath $(firstword $(MAKEFILE_LIST)))) GITREV ?= $(shell test -s $(MAKEDIR)/.git && git rev-parse --short HEAD) @@ -107,8 +116,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.1\033[0m\n' ################################################################################ From fd3602bd623448dfcccd263e03a33d5073633623 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Thu, 10 Oct 2024 13:31:30 +0300 Subject: [PATCH 02/15] Dependencies update --- go.mod | 8 ++++---- go.sum | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index 2beb118..4e9bb70 100644 --- a/go.mod +++ b/go.mod @@ -1,10 +1,10 @@ module github.com/essentialkaos/path -go 1.21 +go 1.22.8 -require github.com/essentialkaos/ek/v13 v13.5.1 +require github.com/essentialkaos/ek/v13 v13.6.0 require ( - github.com/essentialkaos/depsy v1.3.0 // indirect - golang.org/x/sys v0.25.0 // indirect + github.com/essentialkaos/depsy v1.3.1 // indirect + golang.org/x/sys v0.26.0 // indirect ) diff --git a/go.sum b/go.sum index aaab24e..81f1b5e 100644 --- a/go.sum +++ b/go.sum @@ -1,14 +1,14 @@ 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/v13 v13.5.1 h1:xkr3d5uAzs69AqI0oKHjjZIsowKdR117AMBv+Dop4Fk= -github.com/essentialkaos/ek/v13 v13.5.1/go.mod h1:KBOtJlrIC2etc/EXvMdbz1JeKmtkuVdK6uRW/ap0OPM= +github.com/essentialkaos/depsy v1.3.1 h1:00k9QcMsdPM4IzDaEFHsTHBD/zoM0oxtB5+dMUwbQa8= +github.com/essentialkaos/depsy v1.3.1/go.mod h1:B5+7Jhv2a2RacOAxIKU2OeJp9QfZjwIpEEPI5X7auWM= +github.com/essentialkaos/ek/v13 v13.6.0 h1:8qb5R/dl5LEov0OfQXBwq3MSbHJjHSY62IKZG4lfy9M= +github.com/essentialkaos/ek/v13 v13.6.0/go.mod h1:S5mCn90ernaPiLzwzV84XN5Sx+Qcdxed6mFPSq8EBDs= 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/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= -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= +github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= +github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= From 2c762687bf436ad4968c322f8730fd27b4ba6d23 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Thu, 10 Oct 2024 13:32:19 +0300 Subject: [PATCH 03/15] Improve README --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ab373e1..515a25f 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ Summary #### From source -To build the `path` from scratch, make sure you have a working Go 1.22+ workspace (_[instructions](https://go.dev/doc/install)_), then: +To build the `path` from scratch, make sure you have a working [Go 1.22+](https://github.com/essentialkaos/.github/blob/master/GO-VERSION-SUPPORT.md) workspace (_[instructions](https://go.dev/doc/install)_), then: ``` go install github.com/essentialkaos/path@latest @@ -69,8 +69,8 @@ go install github.com/essentialkaos/path@latest #### From [ESSENTIAL KAOS Public Repository](https://kaos.sh/kaos-repo) for EL 7/8/9 ```bash -sudo yum install -y https://pkgs.kaos.st/kaos-repo-latest.el$(grep 'CPE_NAME' /etc/os-release | tr -d '"' | cut -d':' -f5).noarch.rpm -sudo yum install path +sudo dnf install -y https://pkgs.kaos.st/kaos-repo-latest.el$(grep 'CPE_NAME' /etc/os-release | tr -d '"' | cut -d':' -f5).noarch.rpm +sudo dnf install path ``` #### Prebuilt binaries From 853bd7f6c36f97ab590576c3c0ab3110d8cb046a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 03:24:13 +0000 Subject: [PATCH 04/15] Bump github.com/essentialkaos/ek/v13 in the all group across 1 directory Bumps the all group with 1 update in the / directory: [github.com/essentialkaos/ek/v13](https://github.com/essentialkaos/ek). Updates `github.com/essentialkaos/ek/v13` from 13.6.0 to 13.8.0 - [Release notes](https://github.com/essentialkaos/ek/releases) - [Changelog](https://github.com/essentialkaos/ek/blob/master/CHANGELOG.md) - [Commits](https://github.com/essentialkaos/ek/compare/v13.6.0...v13.8.0) --- updated-dependencies: - dependency-name: github.com/essentialkaos/ek/v13 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: all ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 4e9bb70..23db0d2 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module github.com/essentialkaos/path go 1.22.8 -require github.com/essentialkaos/ek/v13 v13.6.0 +require github.com/essentialkaos/ek/v13 v13.8.0 require ( github.com/essentialkaos/depsy v1.3.1 // indirect diff --git a/go.sum b/go.sum index 81f1b5e..f4db688 100644 --- a/go.sum +++ b/go.sum @@ -1,9 +1,9 @@ -github.com/essentialkaos/check v1.4.0 h1:kWdFxu9odCxUqo1NNFNJmguGrDHgwi3A8daXX1nkuKk= -github.com/essentialkaos/check v1.4.0/go.mod h1:LMKPZ2H+9PXe7Y2gEoKyVAwUqXVgx7KtgibfsHJPus0= +github.com/essentialkaos/check v1.4.1 h1:SuxXzrbokPGTPWxGRnzy0hXvtb44mtVrdNxgPa1s4c8= +github.com/essentialkaos/check v1.4.1/go.mod h1:xQOYwFvnxfVZyt5Qvjoa1SxcRqu5VyP77pgALr3iu+M= github.com/essentialkaos/depsy v1.3.1 h1:00k9QcMsdPM4IzDaEFHsTHBD/zoM0oxtB5+dMUwbQa8= github.com/essentialkaos/depsy v1.3.1/go.mod h1:B5+7Jhv2a2RacOAxIKU2OeJp9QfZjwIpEEPI5X7auWM= -github.com/essentialkaos/ek/v13 v13.6.0 h1:8qb5R/dl5LEov0OfQXBwq3MSbHJjHSY62IKZG4lfy9M= -github.com/essentialkaos/ek/v13 v13.6.0/go.mod h1:S5mCn90ernaPiLzwzV84XN5Sx+Qcdxed6mFPSq8EBDs= +github.com/essentialkaos/ek/v13 v13.8.0 h1:6CrdnWQBqPM9gyCBz0HGjRzH++rjsvAL4P1k/IovMtk= +github.com/essentialkaos/ek/v13 v13.8.0/go.mod h1:6G9EPJ/k4N0mugTLqPuWS/fb7K5JwoEqZSkNSfBCsgg= 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= From 0814516e7d06a2a9d9d2e0515f9b8760e507887a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 18 Oct 2024 03:46:57 +0000 Subject: [PATCH 05/15] Bump github.com/essentialkaos/ek/v13 in the all group Bumps the all group with 1 update: [github.com/essentialkaos/ek/v13](https://github.com/essentialkaos/ek). Updates `github.com/essentialkaos/ek/v13` from 13.8.0 to 13.8.1 - [Release notes](https://github.com/essentialkaos/ek/releases) - [Changelog](https://github.com/essentialkaos/ek/blob/master/CHANGELOG.md) - [Commits](https://github.com/essentialkaos/ek/compare/v13.8.0...v13.8.1) --- updated-dependencies: - dependency-name: github.com/essentialkaos/ek/v13 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 23db0d2..d14d001 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module github.com/essentialkaos/path go 1.22.8 -require github.com/essentialkaos/ek/v13 v13.8.0 +require github.com/essentialkaos/ek/v13 v13.8.1 require ( github.com/essentialkaos/depsy v1.3.1 // indirect diff --git a/go.sum b/go.sum index f4db688..2b64a3f 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,8 @@ github.com/essentialkaos/check v1.4.1 h1:SuxXzrbokPGTPWxGRnzy0hXvtb44mtVrdNxgPa1 github.com/essentialkaos/check v1.4.1/go.mod h1:xQOYwFvnxfVZyt5Qvjoa1SxcRqu5VyP77pgALr3iu+M= github.com/essentialkaos/depsy v1.3.1 h1:00k9QcMsdPM4IzDaEFHsTHBD/zoM0oxtB5+dMUwbQa8= github.com/essentialkaos/depsy v1.3.1/go.mod h1:B5+7Jhv2a2RacOAxIKU2OeJp9QfZjwIpEEPI5X7auWM= -github.com/essentialkaos/ek/v13 v13.8.0 h1:6CrdnWQBqPM9gyCBz0HGjRzH++rjsvAL4P1k/IovMtk= -github.com/essentialkaos/ek/v13 v13.8.0/go.mod h1:6G9EPJ/k4N0mugTLqPuWS/fb7K5JwoEqZSkNSfBCsgg= +github.com/essentialkaos/ek/v13 v13.8.1 h1:f8JDWsKzp1egqf7Rw2PJBEtOzExVVYbd2ldSuD2TxLM= +github.com/essentialkaos/ek/v13 v13.8.1/go.mod h1:6G9EPJ/k4N0mugTLqPuWS/fb7K5JwoEqZSkNSfBCsgg= 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= From e6442e1ee404098f7a943742c9691d7b2f6eaefd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Oct 2024 03:55:00 +0000 Subject: [PATCH 06/15] Bump github.com/essentialkaos/ek/v13 in the all group Bumps the all group with 1 update: [github.com/essentialkaos/ek/v13](https://github.com/essentialkaos/ek). Updates `github.com/essentialkaos/ek/v13` from 13.8.1 to 13.9.0 - [Release notes](https://github.com/essentialkaos/ek/releases) - [Changelog](https://github.com/essentialkaos/ek/blob/master/CHANGELOG.md) - [Commits](https://github.com/essentialkaos/ek/compare/v13.8.1...v13.9.0) --- updated-dependencies: - dependency-name: github.com/essentialkaos/ek/v13 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: all ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index d14d001..10e2d22 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module github.com/essentialkaos/path go 1.22.8 -require github.com/essentialkaos/ek/v13 v13.8.1 +require github.com/essentialkaos/ek/v13 v13.9.0 require ( github.com/essentialkaos/depsy v1.3.1 // indirect diff --git a/go.sum b/go.sum index 2b64a3f..88755fa 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,8 @@ github.com/essentialkaos/check v1.4.1 h1:SuxXzrbokPGTPWxGRnzy0hXvtb44mtVrdNxgPa1 github.com/essentialkaos/check v1.4.1/go.mod h1:xQOYwFvnxfVZyt5Qvjoa1SxcRqu5VyP77pgALr3iu+M= github.com/essentialkaos/depsy v1.3.1 h1:00k9QcMsdPM4IzDaEFHsTHBD/zoM0oxtB5+dMUwbQa8= github.com/essentialkaos/depsy v1.3.1/go.mod h1:B5+7Jhv2a2RacOAxIKU2OeJp9QfZjwIpEEPI5X7auWM= -github.com/essentialkaos/ek/v13 v13.8.1 h1:f8JDWsKzp1egqf7Rw2PJBEtOzExVVYbd2ldSuD2TxLM= -github.com/essentialkaos/ek/v13 v13.8.1/go.mod h1:6G9EPJ/k4N0mugTLqPuWS/fb7K5JwoEqZSkNSfBCsgg= +github.com/essentialkaos/ek/v13 v13.9.0 h1:tJ2RGnG5N5jBd2dLF2F+yHGL0WXj4GWkexxa4zz3OnE= +github.com/essentialkaos/ek/v13 v13.9.0/go.mod h1:6G9EPJ/k4N0mugTLqPuWS/fb7K5JwoEqZSkNSfBCsgg= 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= From e017c3d198674cc3308ad4a29022649954028d56 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Mon, 21 Oct 2024 14:00:37 +0300 Subject: [PATCH 07/15] Fix compatibility with the latest version of ek package --- cli/cli.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/cli.go b/cli/cli.go index c86e91e..71fabd4 100644 --- a/cli/cli.go +++ b/cli/cli.go @@ -108,7 +108,7 @@ func Run(gitRev string, gomod []byte) { if !errs.IsEmpty() { terminal.Error("Options parsing errors:") - terminal.Error(errs.String()) + terminal.Error(errs.Error("- ")) os.Exit(1) } From d03e98cda375c7d16485c2831cb9f67b9187cbdb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 29 Oct 2024 03:13:51 +0000 Subject: [PATCH 08/15] Bump github.com/essentialkaos/ek/v13 in the all group across 1 directory Bumps the all group with 1 update in the / directory: [github.com/essentialkaos/ek/v13](https://github.com/essentialkaos/ek). Updates `github.com/essentialkaos/ek/v13` from 13.9.0 to 13.9.2 - [Release notes](https://github.com/essentialkaos/ek/releases) - [Changelog](https://github.com/essentialkaos/ek/blob/master/CHANGELOG.md) - [Commits](https://github.com/essentialkaos/ek/compare/v13.9.0...v13.9.2) --- updated-dependencies: - dependency-name: github.com/essentialkaos/ek/v13 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 10e2d22..979bcac 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module github.com/essentialkaos/path go 1.22.8 -require github.com/essentialkaos/ek/v13 v13.9.0 +require github.com/essentialkaos/ek/v13 v13.9.2 require ( github.com/essentialkaos/depsy v1.3.1 // indirect diff --git a/go.sum b/go.sum index 88755fa..6649d2b 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,8 @@ github.com/essentialkaos/check v1.4.1 h1:SuxXzrbokPGTPWxGRnzy0hXvtb44mtVrdNxgPa1 github.com/essentialkaos/check v1.4.1/go.mod h1:xQOYwFvnxfVZyt5Qvjoa1SxcRqu5VyP77pgALr3iu+M= github.com/essentialkaos/depsy v1.3.1 h1:00k9QcMsdPM4IzDaEFHsTHBD/zoM0oxtB5+dMUwbQa8= github.com/essentialkaos/depsy v1.3.1/go.mod h1:B5+7Jhv2a2RacOAxIKU2OeJp9QfZjwIpEEPI5X7auWM= -github.com/essentialkaos/ek/v13 v13.9.0 h1:tJ2RGnG5N5jBd2dLF2F+yHGL0WXj4GWkexxa4zz3OnE= -github.com/essentialkaos/ek/v13 v13.9.0/go.mod h1:6G9EPJ/k4N0mugTLqPuWS/fb7K5JwoEqZSkNSfBCsgg= +github.com/essentialkaos/ek/v13 v13.9.2 h1:3sXGDUZ5C5+8tSmat1cTj6lhYIzCOlcaHC2ulShF2OQ= +github.com/essentialkaos/ek/v13 v13.9.2/go.mod h1:6G9EPJ/k4N0mugTLqPuWS/fb7K5JwoEqZSkNSfBCsgg= 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= From 272d347bf0bfe659097047705c3982a0098bad7e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 Nov 2024 03:52:48 +0000 Subject: [PATCH 09/15] Bump github.com/essentialkaos/ek/v13 in the all group Bumps the all group with 1 update: [github.com/essentialkaos/ek/v13](https://github.com/essentialkaos/ek). Updates `github.com/essentialkaos/ek/v13` from 13.9.2 to 13.10.0 - [Release notes](https://github.com/essentialkaos/ek/releases) - [Changelog](https://github.com/essentialkaos/ek/blob/master/CHANGELOG.md) - [Commits](https://github.com/essentialkaos/ek/compare/v13.9.2...v13.10.0) --- updated-dependencies: - dependency-name: github.com/essentialkaos/ek/v13 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: all ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 979bcac..f389674 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module github.com/essentialkaos/path go 1.22.8 -require github.com/essentialkaos/ek/v13 v13.9.2 +require github.com/essentialkaos/ek/v13 v13.10.0 require ( github.com/essentialkaos/depsy v1.3.1 // indirect diff --git a/go.sum b/go.sum index 6649d2b..8a872a2 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,8 @@ github.com/essentialkaos/check v1.4.1 h1:SuxXzrbokPGTPWxGRnzy0hXvtb44mtVrdNxgPa1 github.com/essentialkaos/check v1.4.1/go.mod h1:xQOYwFvnxfVZyt5Qvjoa1SxcRqu5VyP77pgALr3iu+M= github.com/essentialkaos/depsy v1.3.1 h1:00k9QcMsdPM4IzDaEFHsTHBD/zoM0oxtB5+dMUwbQa8= github.com/essentialkaos/depsy v1.3.1/go.mod h1:B5+7Jhv2a2RacOAxIKU2OeJp9QfZjwIpEEPI5X7auWM= -github.com/essentialkaos/ek/v13 v13.9.2 h1:3sXGDUZ5C5+8tSmat1cTj6lhYIzCOlcaHC2ulShF2OQ= -github.com/essentialkaos/ek/v13 v13.9.2/go.mod h1:6G9EPJ/k4N0mugTLqPuWS/fb7K5JwoEqZSkNSfBCsgg= +github.com/essentialkaos/ek/v13 v13.10.0 h1:uoLNjiDRJ/bOPAciq8Ff92r+XHgTm+rBI4ItOtZje9k= +github.com/essentialkaos/ek/v13 v13.10.0/go.mod h1:6G9EPJ/k4N0mugTLqPuWS/fb7K5JwoEqZSkNSfBCsgg= 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= From 4f08e0cfd9b441fb5d5bfdf71a0d2665931ce6aa Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Fri, 8 Nov 2024 11:44:33 +0300 Subject: [PATCH 10/15] Dependencies update --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index f389674..9336592 100644 --- a/go.mod +++ b/go.mod @@ -6,5 +6,5 @@ require github.com/essentialkaos/ek/v13 v13.10.0 require ( github.com/essentialkaos/depsy v1.3.1 // indirect - golang.org/x/sys v0.26.0 // indirect + golang.org/x/sys v0.27.0 // indirect ) diff --git a/go.sum b/go.sum index 8a872a2..2b666a3 100644 --- a/go.sum +++ b/go.sum @@ -10,5 +10,5 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= -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/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= +golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= From 148bb2fe69976f975749013c75e924f99cf19db8 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Fri, 8 Nov 2024 11:50:32 +0300 Subject: [PATCH 11/15] Add 'strip-ext' command --- cli/cli.go | 6 +++++- cli/commands.go | 29 +++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/cli/cli.go b/cli/cli.go index 71fabd4..f58f3c5 100644 --- a/cli/cli.go +++ b/cli/cli.go @@ -31,7 +31,7 @@ import ( // Basic utility info const ( APP = "path" - VER = "1.0.3" + VER = "1.1.0" DESC = "Dead simple tool for working with paths" ) @@ -70,6 +70,7 @@ const ( CMD_ADD_SUFFIX = "add-suffix" CMD_DEL_SUFFIX = "del-suffix" CMD_EXCLUDE = "exclude" + CMD_STRIP_EXT = "strip-ext" CMD_IS_ABS = "is-abs" CMD_IS_LOCAL = "is-local" @@ -200,6 +201,8 @@ func process(args options.Arguments) (error, bool) { return cmdDelSuffix(cmdArgs) case CMD_EXCLUDE: return cmdExclude(cmdArgs) + case CMD_STRIP_EXT: + return cmdStripExt(cmdArgs) case CMD_IS_ABS: return cmdIsAbs(cmdArgs) @@ -268,6 +271,7 @@ func genUsage() *usage.Info { info.AddCommand(CMD_ADD_SUFFIX, "Add the substring at the end", "suffix", "?path") info.AddCommand(CMD_DEL_SUFFIX, "Remove the substring at the end", "suffix", "?path") info.AddCommand(CMD_EXCLUDE, "Exclude part of the string", "substr", "?path") + info.AddCommand(CMD_STRIP_EXT, "Remove file extension", "?path") info.AddCommand(CMD_IS_ABS, "Check if given path is absolute", "?path") info.AddCommand(CMD_IS_LOCAL, "Check if given path is local", "?path") diff --git a/cli/commands.go b/cli/commands.go index d59714c..08da849 100644 --- a/cli/commands.go +++ b/cli/commands.go @@ -435,6 +435,35 @@ func cmdExclude(args options.Arguments) (error, bool) { return nil, true } +// cmdStripExt is handler for "strip-ext" command +func cmdStripExt(args options.Arguments) (error, bool) { + var result []string + + input, err := getInputData(args) + + if err != nil { + return err, false + } + + for _, item := range input { + ext := path.Ext(item) + + if ext != "" { + result = append(result, strings.TrimSuffix(item, ext)) + } else { + result = append(result, item) + } + } + + if len(result) == 0 { + return err, false + } + + fmt.Println(strings.Join(result, getSeparator())) + + return nil, true +} + // cmdIsAbs is handler for "is-abs" command func cmdIsAbs(args options.Arguments) (error, bool) { input, err := getInputData(args) From 3459dd3b30c3e95ff3a10fae15df0adb1135bb85 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Fri, 8 Nov 2024 11:51:07 +0300 Subject: [PATCH 12/15] Regenerate usage svg --- .github/images/usage.svg | 53 ++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/.github/images/usage.svg b/.github/images/usage.svg index b25670a..fffd44e 100644 --- a/.github/images/usage.svg +++ b/.github/images/usage.svg @@ -1,5 +1,5 @@ - - + + path Usage @@ -45,7 +45,7 @@ - + @@ -73,28 +73,29 @@ add-suffix suffix path .. Add the substring at the end del-suffix suffix path .. Remove the substring at the end exclude substr path ..... Exclude part of the string - is-abs path ............. Check if given path is absolute - is-local path ........... Check if given path is local - is-safe path ............ Check if given path is safe - is-match pattern path ... Check if given path is match to pattern - Options - --zero, -z ....... End each output line with NUL, not newline - --space, -s ...... End each output line with space, not newline - --quiet, -q ...... Suppress all error messages - --no-color, -nc .. Disable colors in output - --help, -h ....... Show this help message - --version, -v .... Show version - Examples - path base /path/to/file.txt - → file.txt - path dir /path/to/file.txt - → /path/to - path compact /very/long/path/to/some/file.txt - → /v/l/p/t/s/file.txt - ls -1 | path is-match '*.txt' && echo MATCH! - Check if all files in current directory is match to pattern - PATH_QUIET=1 path dir /path/to/file.txt - Run dir command in quiet mode enabled by environment variable + strip-ext path .......... Remove file extension + is-abs path ............. Check if given path is absolute + is-local path ........... Check if given path is local + is-safe path ............ Check if given path is safe + is-match pattern path ... Check if given path is match to pattern + Options + --zero, -z ....... End each output line with NUL, not newline + --space, -s ...... End each output line with space, not newline + --quiet, -q ...... Suppress all error messages + --no-color, -nc .. Disable colors in output + --help, -h ....... Show this help message + --version, -v .... Show version + Examples + path base /path/to/file.txt + → file.txt + path dir /path/to/file.txt + → /path/to + path compact /very/long/path/to/some/file.txt + → /v/l/p/t/s/file.txt + ls -1 | path is-match '*.txt' && echo MATCH! + Check if all files in current directory is match to pattern + PATH_QUIET=1 path dir /path/to/file.txt + Run dir command in quiet mode enabled by environment variable - + From d0009c0eacb03844e7b1bb2e490450543e512561 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Fri, 8 Nov 2024 11:52:28 +0300 Subject: [PATCH 13/15] Update bibop tests --- .bibop/path.recipe | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.bibop/path.recipe b/.bibop/path.recipe index b40d498..607c638 100644 --- a/.bibop/path.recipe +++ b/.bibop/path.recipe @@ -117,6 +117,12 @@ command "path -s exclude _small john_small.jpg bob_small.jpg jack_small.jpg" ################################################################################ +command "path -s strip-ext john.jpg bob.png jack.TIFF" + exit 0 + output-contains "john bob jack" + +################################################################################ + command "path is-abs /home/user/bob/file.txt" "Check is-abs command" exit 0 From 469f1cd2aded69009d5d20c3c671fa412a20bc34 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Fri, 8 Nov 2024 11:56:18 +0300 Subject: [PATCH 14/15] Improve README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 515a25f..09d979c 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ find . -mindepth 1 -maxdepth 1 -type d -exec basename {} \; find . -mindepth 1 -maxdepth 1 -type d | path basename ``` -Also, it works MUCH faster: +Also, it works **MUCH** faster (~120x): ``` $ git clone https://github.com/kubernetes/kubernetes.git --depth=1 @@ -66,7 +66,7 @@ To build the `path` from scratch, make sure you have a working [Go 1.22+](https: go install github.com/essentialkaos/path@latest ``` -#### From [ESSENTIAL KAOS Public Repository](https://kaos.sh/kaos-repo) for EL 7/8/9 +#### From [ESSENTIAL KAOS Public Repository](https://kaos.sh/kaos-repo) for EL 8/9 ```bash sudo dnf install -y https://pkgs.kaos.st/kaos-repo-latest.el$(grep 'CPE_NAME' /etc/os-release | tr -d '"' | cut -d':' -f5).noarch.rpm From 9787b6b78eebe10ce4bb88c47b048b3b5ec4f259 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Fri, 8 Nov 2024 12:05:21 +0300 Subject: [PATCH 15/15] Improve help content --- .github/images/usage.svg | 42 +++++++++++++++++++------------------- cli/cli.go | 44 ++++++++++++++++++++-------------------- 2 files changed, 43 insertions(+), 43 deletions(-) diff --git a/.github/images/usage.svg b/.github/images/usage.svg index fffd44e..1b63ca7 100644 --- a/.github/images/usage.svg +++ b/.github/images/usage.svg @@ -57,27 +57,27 @@ Usage: path {options} {command} Commands - base path ............... Strip directory and suffix from filenames - dir path ................ Strip last component from file name - dirn num path ........... Return N elements from path - link path ............... Print resolved symbolic links or canonical file names - clean path .............. Print shortest path name equivalent to path by purely - lexical processing - compact path ............ Converts path to compact representation - abs path ................ Print absolute representation of path - ext path ................ Print file extension - match pattern path ...... Filter given path using pattern - join root path .......... Join path elements - add-prefix prefix path .. Add the substring at the beginning - del-prefix prefix path .. Remove the substring at the beginning - add-suffix suffix path .. Add the substring at the end - del-suffix suffix path .. Remove the substring at the end - exclude substr path ..... Exclude part of the string - strip-ext path .......... Remove file extension - is-abs path ............. Check if given path is absolute - is-local path ........... Check if given path is local - is-safe path ............ Check if given path is safe - is-match pattern path ... Check if given path is match to pattern + base path… ............... Strip directory and suffix from filenames + dir path… ................ Strip last component from file name + dirn num path… ........... Return N elements from path + link path… ............... Print resolved symbolic links or canonical file names + clean path… .............. Print shortest path name equivalent to path by purely + lexical processing + compact path… ............ Converts path to compact representation + abs path… ................ Print absolute representation of path + ext path… ................ Print file extension + match pattern path… ...... Filter given path using pattern + join root path… .......... Join path elements + add-prefix prefix path… .. Add the substring at the beginning + del-prefix prefix path… .. Remove the substring at the beginning + add-suffix suffix path… .. Add the substring at the end + del-suffix suffix path… .. Remove the substring at the end + exclude substr path… ..... Exclude part of the string + strip-ext path… .......... Remove file extension + is-abs path… ............. Check if given path is absolute + is-local path… ........... Check if given path is local + is-safe path… ............ Check if given path is safe + is-match pattern path… ... Check if given path is match to pattern Options --zero, -z ....... End each output line with NUL, not newline --space, -s ...... End each output line with space, not newline diff --git a/cli/cli.go b/cli/cli.go index f58f3c5..fa4bf46 100644 --- a/cli/cli.go +++ b/cli/cli.go @@ -255,28 +255,28 @@ func printMan() { func genUsage() *usage.Info { info := usage.NewInfo() - info.AddCommand(CMD_BASENAME, "Strip directory and suffix from filenames", "?path") - info.AddCommand(CMD_DIRNAME, "Strip last component from file name", "?path") - info.AddCommand(CMD_DIRNAME_NUM, "Return N elements from path", "num", "?path") - info.AddCommand(CMD_READLINK, "Print resolved symbolic links or canonical file names", "?path") - info.AddCommand(CMD_CLEAN, "Print shortest path name equivalent to path by purely lexical processing", "?path") - info.AddCommand(CMD_COMPACT, "Converts path to compact representation", "?path") - info.AddCommand(CMD_ABS, "Print absolute representation of path", "?path") - info.AddCommand(CMD_EXT, "Print file extension", "?path") - info.AddCommand(CMD_MATCH, "Filter given path using pattern", "pattern", "?path") - info.AddCommand(CMD_JOIN, "Join path elements", "root", "?path") - - info.AddCommand(CMD_ADD_PREFIX, "Add the substring at the beginning", "prefix", "?path") - info.AddCommand(CMD_DEL_PREFIX, "Remove the substring at the beginning", "prefix", "?path") - info.AddCommand(CMD_ADD_SUFFIX, "Add the substring at the end", "suffix", "?path") - info.AddCommand(CMD_DEL_SUFFIX, "Remove the substring at the end", "suffix", "?path") - info.AddCommand(CMD_EXCLUDE, "Exclude part of the string", "substr", "?path") - info.AddCommand(CMD_STRIP_EXT, "Remove file extension", "?path") - - info.AddCommand(CMD_IS_ABS, "Check if given path is absolute", "?path") - info.AddCommand(CMD_IS_LOCAL, "Check if given path is local", "?path") - info.AddCommand(CMD_IS_SAFE, "Check if given path is safe", "?path") - info.AddCommand(CMD_IS_MATCH, "Check if given path is match to pattern", "pattern", "?path") + info.AddCommand(CMD_BASENAME, "Strip directory and suffix from filenames", "?path…") + info.AddCommand(CMD_DIRNAME, "Strip last component from file name", "?path…") + info.AddCommand(CMD_DIRNAME_NUM, "Return N elements from path", "num", "?path…") + info.AddCommand(CMD_READLINK, "Print resolved symbolic links or canonical file names", "?path…") + info.AddCommand(CMD_CLEAN, "Print shortest path name equivalent to path by purely lexical processing", "?path…") + info.AddCommand(CMD_COMPACT, "Converts path to compact representation", "?path…") + info.AddCommand(CMD_ABS, "Print absolute representation of path", "?path…") + info.AddCommand(CMD_EXT, "Print file extension", "?path…") + info.AddCommand(CMD_MATCH, "Filter given path using pattern", "pattern", "?path…") + info.AddCommand(CMD_JOIN, "Join path elements", "root", "?path…") + + info.AddCommand(CMD_ADD_PREFIX, "Add the substring at the beginning", "prefix", "?path…") + info.AddCommand(CMD_DEL_PREFIX, "Remove the substring at the beginning", "prefix", "?path…") + info.AddCommand(CMD_ADD_SUFFIX, "Add the substring at the end", "suffix", "?path…") + info.AddCommand(CMD_DEL_SUFFIX, "Remove the substring at the end", "suffix", "?path…") + info.AddCommand(CMD_EXCLUDE, "Exclude part of the string", "substr", "?path…") + info.AddCommand(CMD_STRIP_EXT, "Remove file extension", "?path…") + + info.AddCommand(CMD_IS_ABS, "Check if given path is absolute", "?path…") + info.AddCommand(CMD_IS_LOCAL, "Check if given path is local", "?path…") + info.AddCommand(CMD_IS_SAFE, "Check if given path is safe", "?path…") + info.AddCommand(CMD_IS_MATCH, "Check if given path is match to pattern", "pattern", "?path…") info.AddOption(OPT_ZERO, "End each output line with NUL, not newline") info.AddOption(OPT_SPACE, "End each output line with space, not newline")