feat: add dependencies scheck

This commit is contained in:
2026-03-18 10:27:08 +00:00
parent aecbefa7ba
commit d331b0825d
2 changed files with 79 additions and 1 deletions
+22 -1
View File
@@ -1,9 +1,20 @@
package cmd
import "github.com/spf13/cobra"
import (
"fmt"
"os"
"os/exec"
"github.com/spf13/cobra"
)
// Run executes the miro CLI and returns a process exit code.
func Run(args []string) int {
if err := ensureDependencies(); err != nil {
fmt.Fprintln(os.Stderr, err)
return 1
}
rootCmd := newRootCommand()
rootCmd.SetArgs(args)
@@ -27,3 +38,13 @@ func newRootCommand() *cobra.Command {
return rootCmd
}
func ensureDependencies() error {
for _, name := range []string{"bwrap", "screen"} {
if _, err := exec.LookPath(name); err != nil {
return fmt.Errorf("required command %q not found in PATH", name)
}
}
return nil
}