MCPcopy
hub / github.com/lima-vm/lima / Run

Method Run

pkg/plugins/plugins.go:149–167  ·  view source on GitHub ↗
(ctx context.Context, args []string)

Source from the content-addressed store, hash-verified

147}
148
149func (plugin *Plugin) Run(ctx context.Context, args []string) {
150 if err := UpdatePath(); err != nil {
151 logrus.Warnf("failed to update PATH environment: %v", err)
152 // PATH update failure shouldn't prevent plugin execution
153 }
154
155 cmd := exec.CommandContext(ctx, plugin.Path, args...)
156 cmd.Stdin = os.Stdin
157 cmd.Stdout = os.Stdout
158 cmd.Stderr = os.Stderr
159 cmd.Env = os.Environ()
160
161 err := cmd.Run()
162 osutil.HandleExitError(err)
163 if err == nil {
164 os.Exit(0) //nolint:revive // it's intentional to call os.Exit in this function
165 }
166 logrus.Fatalf("external command %q failed: %v", plugin.Path, err)
167}
168
169var descRegex = regexp.MustCompile(`<limactl-desc>(.*?)</limactl-desc>`)
170

Callers 15

TestRegisterDriverFileFunction · 0.45
TestValidIdentifiersFunction · 0.45
TestInvalidIdentifiersFunction · 0.45
TestUserFunction · 0.45
TestStartCmdFunction · 0.45
passwordLessSudoMethod · 0.45
TestUsernetConfigFunction · 0.45
TestSearchDomainFunction · 0.45
Test_hostsMapIPFunction · 0.45
Test_zoneHostFunction · 0.45
TestExtractZonesFunction · 0.45
sudoFunction · 0.45

Calls 2

HandleExitErrorFunction · 0.92
UpdatePathFunction · 0.85

Tested by 15

TestRegisterDriverFileFunction · 0.36
TestValidIdentifiersFunction · 0.36
TestInvalidIdentifiersFunction · 0.36
TestUserFunction · 0.36
TestStartCmdFunction · 0.36
TestUsernetConfigFunction · 0.36
TestSearchDomainFunction · 0.36
Test_hostsMapIPFunction · 0.36
Test_zoneHostFunction · 0.36
TestExtractZonesFunction · 0.36
TestMainFunction · 0.36
TestDownloadRemoteFunction · 0.36