go.mondoo.com/cnquery@v0.0.0-20231005093811-59568235f6ea/providers/os/connection/snapshot/localcmd.go (about)

     1  // Copyright (c) Mondoo, Inc.
     2  // SPDX-License-Identifier: BUSL-1.1
     3  
     4  package snapshot
     5  
     6  import (
     7  	"go.mondoo.com/cnquery/providers/os/connection"
     8  	"go.mondoo.com/cnquery/providers/os/connection/shared"
     9  )
    10  
    11  type LocalCommandRunner struct {
    12  	shell []string
    13  }
    14  
    15  func (r *LocalCommandRunner) RunCommand(command string) (*shared.Command, error) {
    16  	c := connection.CommandRunner{Shell: r.shell}
    17  	args := []string{}
    18  
    19  	res, err := c.Exec(command, args)
    20  	return res, err
    21  }