Skip to content

Commit

Permalink
Merge pull request #55 from ygalblum/virtctl
Browse files Browse the repository at this point in the history
virtctl - add function to check that it is installed
  • Loading branch information
vishnuchalla authored Feb 13, 2025
2 parents 90fbe86 + 79617b3 commit 20bf1a0
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions virtctl/virtctl.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright 2025 The go-commons Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package virtctl

import "os/exec"

func IsInstalled() bool {
err := exec.Command("virtctl", "version").Run()
return err == nil
}

0 comments on commit 20bf1a0

Please sign in to comment.