• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

foomo / posh / 11530910473

26 Oct 2024 10:01AM UTC coverage: 7.626% (-0.3%) from 7.938%
11530910473

push

github

web-flow
Merge pull request #83 from foomo/posh-v0.8.x

Posh v0.8.x

0 of 238 new or added lines in 12 files covered. (0.0%)

6 existing lines in 5 files now uncovered.

194 of 2544 relevant lines covered (7.63%)

0.88 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/cmd/execute.go
1
package cmd
2

3
import (
4
        intcmd "github.com/foomo/posh/internal/cmd"
5
        intconfig "github.com/foomo/posh/internal/config"
6
        "github.com/pkg/errors"
7
        "github.com/spf13/cobra"
8
)
9

10
// NewExecute represents the exec command
NEW
11
func NewExecute(root *cobra.Command) {
×
NEW
12
        cmd := &cobra.Command{
×
NEW
13
                Use:                "execute",
×
NEW
14
                Short:              "Execute a single Project Oriented Shell command",
×
NEW
15
                Args:               cobra.ArbitraryArgs,
×
NEW
16
                DisableFlagParsing: true,
×
NEW
17
                SilenceUsage:       true,
×
NEW
18
                SilenceErrors:      true,
×
NEW
19
                PreRunE: func(cmd *cobra.Command, args []string) error {
×
NEW
20
                        l := intcmd.NewLogger()
×
NEW
21
                        if err := intconfig.Load(l); err != nil {
×
NEW
22
                                return err
×
NEW
23
                        }
×
NEW
24
                        return nil
×
25
                },
NEW
26
                RunE: func(cmd *cobra.Command, args []string) error {
×
NEW
27
                        l := intcmd.NewLogger()
×
NEW
28
                        if len(args) == 0 {
×
NEW
29
                                return errors.New("missing [cmd] argument")
×
NEW
30
                        }
×
31

NEW
32
                        plg, err := pluginProvider(l)
×
NEW
33
                        if err != nil {
×
NEW
34
                                return err
×
NEW
35
                        }
×
36

NEW
37
                        return plg.Execute(cmd.Context(), args)
×
38
                },
39
        }
40

NEW
41
        root.AddCommand(cmd)
×
42
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc