package scheduler

import (
	"fmt"
	"os"

	"github.com/salvacybersec/keyhunter/pkg/engine/sources"
)

// selectSchedulerSource returns the appropriate Source for a scheduled scan path.
// Only file and directory paths are supported (same as bot scans).
func selectSchedulerSource(path string) (sources.Source, error) {
	info, err := os.Stat(path)
	if err != nil {
		return nil, fmt.Errorf("stat %q: %w", path, err)
	}
	if info.IsDir() {
		return sources.NewDirSource(path), nil
	}
	return sources.NewFileSource(path), nil
}
