Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/cd-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ jobs:
fetch-depth: 0

- name: Login to DockerHub
uses: docker/login-action@v3
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand Down Expand Up @@ -149,7 +149,7 @@ jobs:

- name: Build and push Docker images (Docker)
if: ${{ steps.build_check.outputs.build == 'true' }}
uses: docker/build-push-action@v6
uses: docker/build-push-action@v7
with:
push: true
context: .
Expand All @@ -160,7 +160,7 @@ jobs:

- name: Build and push Docker images (GHCR)
if: ${{ steps.build_check.outputs.build == 'true' }}
uses: docker/build-push-action@v6
uses: docker/build-push-action@v7
with:
push: true
context: .
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
uses: actions/checkout@v6

- name: Login to DockerHub
uses: docker/login-action@v3
uses: docker/login-action@v4
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
if: ${{ env.DOCKERHUB_USERNAME != '' }}
Expand All @@ -52,7 +52,7 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ https://github.com/essentialkaos/bibop/assets/182020/c63dc147-fa44-40df-92e2-12f

#### From source

To build the `bibop` from scratch, make sure you have a working Go [1.24+](https://github.com/essentialkaos/.github/blob/master/GO-VERSION-SUPPORT.md) workspace ([instructions](https://go.dev/doc/install)), then:
To build the `bibop` from scratch, make sure you have a working Go [1.25+](https://github.com/essentialkaos/.github/blob/master/GO-VERSION-SUPPORT.md) workspace ([instructions](https://go.dev/doc/install)), then:

```
go install github.com/essentialkaos/bibop@latest
Expand Down
2 changes: 1 addition & 1 deletion action/auxi.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"strings"

"github.com/essentialkaos/bibop/recipe"
"github.com/essentialkaos/ek/v13/strutil"
"github.com/essentialkaos/ek/v14/strutil"
)

// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down
2 changes: 1 addition & 1 deletion action/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"hash/crc32"
"os"

"github.com/essentialkaos/ek/v13/fsutil"
"github.com/essentialkaos/ek/v14/fsutil"

"github.com/essentialkaos/bibop/recipe"
)
Expand Down
8 changes: 4 additions & 4 deletions action/basic.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
"syscall"
"time"

"github.com/essentialkaos/ek/v13/mathutil"
"github.com/essentialkaos/ek/v13/timeutil"
"github.com/essentialkaos/ek/v14/mathutil"
"github.com/essentialkaos/ek/v14/timeutil"

"github.com/essentialkaos/bibop/recipe"
)
Expand All @@ -31,7 +31,7 @@ func Wait(action *recipe.Action) error {

durSec = mathutil.Between(durSec, 0.01, 3600.0)

time.Sleep(timeutil.SecondsToDuration(durSec))
time.Sleep(timeutil.ToSeconds(durSec))

return nil
}
Expand Down Expand Up @@ -70,7 +70,7 @@ func Exit(action *recipe.Action, cmd *exec.Cmd) error {
break
}

if time.Since(start) > timeutil.SecondsToDuration(timeout) {
if time.Since(start) > timeutil.ToSeconds(timeout) {
return fmt.Errorf("Reached timeout (%g sec)", timeout)
}
}
Expand Down
8 changes: 4 additions & 4 deletions action/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ import (
"strconv"
"strings"

"github.com/essentialkaos/ek/v13/fsutil"
"github.com/essentialkaos/ek/v13/hashutil"
"github.com/essentialkaos/ek/v13/strutil"
"github.com/essentialkaos/ek/v13/system"
"github.com/essentialkaos/ek/v14/fsutil"
"github.com/essentialkaos/ek/v14/hashutil"
"github.com/essentialkaos/ek/v14/strutil"
"github.com/essentialkaos/ek/v14/system"

"github.com/essentialkaos/bibop/recipe"
)
Expand Down
2 changes: 1 addition & 1 deletion action/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"fmt"
"strings"

"github.com/essentialkaos/ek/v13/req"
"github.com/essentialkaos/ek/v14/req"

"github.com/buger/jsonparser"

Expand Down
8 changes: 4 additions & 4 deletions action/io.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (
"strings"
"time"

"github.com/essentialkaos/ek/v13/mathutil"
"github.com/essentialkaos/ek/v13/timeutil"
"github.com/essentialkaos/ek/v14/mathutil"
"github.com/essentialkaos/ek/v14/timeutil"

"github.com/essentialkaos/bibop/recipe"
)
Expand Down Expand Up @@ -49,7 +49,7 @@ func Expect(action *recipe.Action, output *OutputContainer) error {

start := time.Now()
timeout = mathutil.Between(timeout, 0.01, 3600.0)
timeoutDur := timeutil.SecondsToDuration(timeout)
timeoutDur := timeutil.ToSeconds(timeout)

for range time.NewTicker(_DATA_READ_PERIOD).C {
if bytes.Contains(output.Bytes(), []byte(substr)) {
Expand All @@ -74,7 +74,7 @@ func WaitOutput(action *recipe.Action, output *OutputContainer) error {
}

start := time.Now()
timeoutDur := timeutil.SecondsToDuration(timeout)
timeoutDur := timeutil.ToSeconds(timeout)

for range time.NewTicker(_DATA_READ_PERIOD).C {
if !output.IsEmpty() {
Expand Down
4 changes: 2 additions & 2 deletions action/libs.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (
"slices"
"strings"

"github.com/essentialkaos/ek/v13/fsutil"
"github.com/essentialkaos/ek/v13/strutil"
"github.com/essentialkaos/ek/v14/fsutil"
"github.com/essentialkaos/ek/v14/strutil"

"github.com/essentialkaos/bibop/recipe"
)
Expand Down
8 changes: 4 additions & 4 deletions action/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (
"fmt"
"time"

"github.com/essentialkaos/ek/v13/initsystem"
"github.com/essentialkaos/ek/v13/mathutil"
"github.com/essentialkaos/ek/v13/timeutil"
"github.com/essentialkaos/ek/v14/initsystem"
"github.com/essentialkaos/ek/v14/mathutil"
"github.com/essentialkaos/ek/v14/timeutil"

"github.com/essentialkaos/bibop/recipe"
)
Expand Down Expand Up @@ -110,7 +110,7 @@ func WaitService(action *recipe.Action) error {

start := time.Now()
timeout = mathutil.Between(timeout, 0.01, 3600.0)
timeoutDur := timeutil.SecondsToDuration(timeout)
timeoutDur := timeutil.ToSeconds(timeout)

for range time.NewTicker(time.Second / 2).C {
isWorks, err := initsystem.IsWorks(service)
Expand Down
41 changes: 21 additions & 20 deletions action/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,18 @@ import (
"net"
"os"
"os/exec"
"path"
"strconv"
"strings"
"syscall"
"time"

"github.com/essentialkaos/ek/v13/env"
"github.com/essentialkaos/ek/v13/fsutil"
"github.com/essentialkaos/ek/v13/mathutil"
"github.com/essentialkaos/ek/v13/pid"
"github.com/essentialkaos/ek/v13/signal"
"github.com/essentialkaos/ek/v13/timeutil"
"github.com/essentialkaos/ek/v14/env"
"github.com/essentialkaos/ek/v14/fsutil"
"github.com/essentialkaos/ek/v14/mathutil"
"github.com/essentialkaos/ek/v14/pid"
"github.com/essentialkaos/ek/v14/signal"
"github.com/essentialkaos/ek/v14/timeutil"

"github.com/essentialkaos/bibop/recipe"
)
Expand All @@ -42,13 +43,13 @@ func ProcessWorks(action *recipe.Action) error {
return err
}

ppid := pid.Read(pidFile)
ppid, err := pid.Read(pidFile)

if ppid == -1 {
return ErrCantReadPIDFile
if err != nil {
return fmt.Errorf("%w: %w", ErrCantReadPIDFile, err)
}

isWorks := fsutil.IsExist("/proc/" + strconv.Itoa(ppid))
isWorks := fsutil.IsExist(path.Join("/proc", strconv.Itoa(ppid)))

switch {
case !action.Negative && !isWorks:
Expand Down Expand Up @@ -88,7 +89,7 @@ func WaitPID(action *recipe.Action) error {

start := time.Now()
timeout = mathutil.Between(timeout, 0.01, 3600.0)
timeoutDur := timeutil.SecondsToDuration(timeout)
timeoutDur := timeutil.ToSeconds(timeout)

for range time.NewTicker(25 * time.Millisecond).C {
if time.Since(start) >= timeoutDur {
Expand All @@ -97,13 +98,13 @@ func WaitPID(action *recipe.Action) error {

switch {
case !action.Negative && fsutil.IsExist(pidFile):
ppid := pid.Read(pidFile)
ppid, err := pid.Read(pidFile)

if ppid == -1 {
if err != nil {
continue
}

if fsutil.IsExist("/proc/" + strconv.Itoa(ppid)) {
if fsutil.IsExist(path.Join("/proc", strconv.Itoa(ppid))) {
return nil
}
case action.Negative && !fsutil.IsExist(pidFile):
Expand Down Expand Up @@ -148,7 +149,7 @@ func WaitFS(action *recipe.Action) error {

start := time.Now()
timeout = mathutil.Between(timeout, 0.01, 3600.0)
timeoutDur := timeutil.SecondsToDuration(timeout)
timeoutDur := timeutil.ToSeconds(timeout)

for range time.NewTicker(25 * time.Millisecond).C {
switch {
Expand Down Expand Up @@ -204,7 +205,7 @@ func WaitConnect(action *recipe.Action) error {

start := time.Now()
timeout = mathutil.Between(timeout, 0.01, 3600.0)
timeoutDur := timeutil.SecondsToDuration(timeout)
timeoutDur := timeutil.ToSeconds(timeout)

for range time.NewTicker(25 * time.Millisecond).C {
conn, err := net.DialTimeout(network, address, time.Second)
Expand Down Expand Up @@ -265,7 +266,7 @@ func Connect(action *recipe.Action) error {
}

timeout = mathutil.Between(timeout, 0.01, 3600.0)
timeoutDur := timeutil.SecondsToDuration(timeout)
timeoutDur := timeutil.ToSeconds(timeout)

conn, err := net.DialTimeout(network, address, timeoutDur)

Expand Down Expand Up @@ -348,7 +349,7 @@ func Env(action *recipe.Action) error {
return err
}

envValue := env.Get().GetS(name)
envValue := os.Getenv(name)

switch {
case !action.Negative && envValue != value:
Expand Down Expand Up @@ -430,9 +431,9 @@ func sendSignalToCmd(sig syscall.Signal, cmd *exec.Cmd) error {

// sendSignalToPID sends signal to PID from PID file
func sendSignalToPID(sig syscall.Signal, pidFile string) error {
ppid := pid.Read(pidFile)
ppid, err := pid.Read(pidFile)

if ppid == -1 {
if err != nil {
return ErrCantReadPIDFile
}

Expand Down
2 changes: 1 addition & 1 deletion action/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ package action
import (
"fmt"

"github.com/essentialkaos/ek/v13/system"
"github.com/essentialkaos/ek/v14/system"

"github.com/essentialkaos/bibop/recipe"
)
Expand Down
6 changes: 3 additions & 3 deletions cli/barcode.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"fmt"
"os/exec"

"github.com/essentialkaos/ek/v13/env"
"github.com/essentialkaos/ek/v13/fmtutil/barcode"
"github.com/essentialkaos/ek/v13/hashutil"
"github.com/essentialkaos/ek/v14/env"
"github.com/essentialkaos/ek/v14/fmtutil/barcode"
"github.com/essentialkaos/ek/v14/hashutil"

"github.com/essentialkaos/bibop/recipe"
)
Expand Down
44 changes: 22 additions & 22 deletions cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,26 @@ import (
"path/filepath"
"strings"

"github.com/essentialkaos/ek/v13/fmtc"
"github.com/essentialkaos/ek/v13/fmtutil"
"github.com/essentialkaos/ek/v13/fmtutil/panel"
"github.com/essentialkaos/ek/v13/fmtutil/table"
"github.com/essentialkaos/ek/v13/fsutil"
"github.com/essentialkaos/ek/v13/options"
"github.com/essentialkaos/ek/v13/req"
"github.com/essentialkaos/ek/v13/strutil"
"github.com/essentialkaos/ek/v13/support"
"github.com/essentialkaos/ek/v13/support/deps"
"github.com/essentialkaos/ek/v13/support/pkgs"
"github.com/essentialkaos/ek/v13/support/resources"
"github.com/essentialkaos/ek/v13/terminal"
"github.com/essentialkaos/ek/v13/terminal/tty"
"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/ek/v14/fmtc"
"github.com/essentialkaos/ek/v14/fmtutil"
"github.com/essentialkaos/ek/v14/fmtutil/panel"
"github.com/essentialkaos/ek/v14/fmtutil/table"
"github.com/essentialkaos/ek/v14/fsutil"
"github.com/essentialkaos/ek/v14/options"
"github.com/essentialkaos/ek/v14/req"
"github.com/essentialkaos/ek/v14/strutil"
"github.com/essentialkaos/ek/v14/support"
"github.com/essentialkaos/ek/v14/support/deps"
"github.com/essentialkaos/ek/v14/support/pkgs"
"github.com/essentialkaos/ek/v14/support/resources"
"github.com/essentialkaos/ek/v14/terminal"
"github.com/essentialkaos/ek/v14/terminal/tty"
"github.com/essentialkaos/ek/v14/usage"
"github.com/essentialkaos/ek/v14/usage/completion/bash"
"github.com/essentialkaos/ek/v14/usage/completion/fish"
"github.com/essentialkaos/ek/v14/usage/completion/zsh"
"github.com/essentialkaos/ek/v14/usage/man"
"github.com/essentialkaos/ek/v14/usage/update"

"github.com/essentialkaos/bibop/cli/executor"
"github.com/essentialkaos/bibop/parser"
Expand All @@ -45,7 +45,7 @@ import (
// Application info
const (
APP = "bibop"
VER = "8.2.2"
VER = "8.3.0"
DESC = "Utility for testing command-line tools"
)

Expand Down Expand Up @@ -120,7 +120,7 @@ func Run(gitRev string, gomod []byte) {

if !errs.IsEmpty() {
terminal.Error("Options parsing errors:")
terminal.Error(errs.Error(" - "))
terminal.Error(errs.ErrorWithPrefix(" - "))
os.Exit(1)
}

Expand Down
Loading
Loading