Add error/hook commands #12

Open
opened 2024-11-04 03:26:23 +00:00 by CyberShell · 1 comment
Owner

Error command can be run on failure, or success. Maybe create hooks. Ref: https://autorestic.vercel.app/location/hooks

Hooks should:

  • Reference commands already defined
  • Be optional
  • Not make the whole command fail
  • Not be recursive or nested in each other
commandName:
  hooks:
    failure: failureCommand

failureCommand:
  cmd: echo "commandName failed"
Error command can be run on failure, or success. Maybe create hooks. Ref: https://autorestic.vercel.app/location/hooks Hooks should: - Reference commands already defined - Be optional - Not make the whole command fail - Not be recursive or nested in each other ```yaml commandName: hooks: failure: failureCommand failureCommand: cmd: echo "commandName failed" ```
Author
Owner

Refactor RunListConfig() and cmdListWorker() or results channel to make this work for lists.

Modify the results channel.

package main

import (
    "fmt"
)

type Person struct {
    Name  string
    Age   int
    Address string
}

func main() {
    ch := make(chan Person)

    go func() {
        p := Person{"John", 30, "123 Main St"}
        ch <- p
    }()

    p := <-ch
    fmt.Println(p.Name, p.Age, p.Address)
}
Refactor `RunListConfig()` and `cmdListWorker()` or results channel to make this work for lists. Modify the `results` channel. ```go package main import ( "fmt" ) type Person struct { Name string Age int Address string } func main() { ch := make(chan Person) go func() { p := Person{"John", 30, "123 Main St"} ch <- p }() p := <-ch fmt.Println(p.Name, p.Age, p.Address) } ```
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: CyberShell/backy#12
No description provided.