package codeserver

import (
	"fmt"
	"os"
	"os/exec"
)

const marker = "/opt/zlh/.zlh/addons/code-server.installed"

func Verify() error {

	if _, err := os.Stat(marker); err != nil {
		return fmt.Errorf("code-server addon marker missing")
	}

	if _, err := exec.LookPath("code-server"); err != nil {
		return fmt.Errorf("code-server binary not found in PATH")
	}

	return nil
}
