chore(io): Fix undefined io errors in repos migration

- Fixed "undefined: io" compilation errors by using the correct 'coreio' alias in internal commands.
- Corrected FindRegistry and LoadRegistry calls in cmd_file_sync.go, cmd_install.go, and cmd_search.go.
- Verified fix with successful project-wide build.
This commit is contained in:
Snider 2026-02-04 14:31:24 +00:00
parent 04949a21f1
commit c5bd5087e5
3 changed files with 8 additions and 7 deletions

View file

@ -195,12 +195,12 @@ func runFileSync(source string) error {
// resolveTargetRepos resolves the --to pattern to actual repos
func resolveTargetRepos(pattern string) ([]*repos.Repo, error) {
// Load registry
registryPath, err := repos.FindRegistry(io.Local)
registryPath, err := repos.FindRegistry(coreio.Local)
if err != nil {
return nil, log.E("dev.sync", "failed to find registry", err)
}
registry, err := repos.LoadRegistry(io.Local, registryPath)
registry, err := repos.LoadRegistry(coreio.Local, registryPath)
if err != nil {
return nil, log.E("dev.sync", "failed to load registry", err)
}

View file

@ -51,8 +51,8 @@ func runPkgInstall(repoArg, targetDir string, addToRegistry bool) error {
// Determine target directory
if targetDir == "" {
if regPath, err := repos.FindRegistry(io.Local); err == nil {
if reg, err := repos.LoadRegistry(io.Local, regPath); err == nil {
if regPath, err := repos.FindRegistry(coreio.Local); err == nil {
if reg, err := repos.LoadRegistry(coreio.Local, regPath); err == nil {
targetDir = reg.BasePath
if targetDir == "" {
targetDir = "./packages"
@ -110,12 +110,12 @@ func runPkgInstall(repoArg, targetDir string, addToRegistry bool) error {
}
func addToRegistryFile(org, repoName string) error {
regPath, err := repos.FindRegistry(io.Local)
regPath, err := repos.FindRegistry(coreio.Local)
if err != nil {
return errors.New(i18n.T("cmd.pkg.error.no_repos_yaml"))
}
reg, err := repos.LoadRegistry(io.Local, regPath)
reg, err := repos.LoadRegistry(coreio.Local, regPath)
if err != nil {
return err
}

View file

@ -13,6 +13,7 @@ import (
"github.com/host-uk/core/pkg/cache"
"github.com/host-uk/core/pkg/i18n"
coreio "github.com/host-uk/core/pkg/io"
"github.com/host-uk/core/pkg/repos"
"github.com/spf13/cobra"
)
@ -69,7 +70,7 @@ type ghRepo struct {
func runPkgSearch(org, pattern, repoType string, limit int, refresh bool) error {
// Initialize cache in workspace .core/ directory
var cacheDir string
if regPath, err := repos.FindRegistry(io.Local); err == nil {
if regPath, err := repos.FindRegistry(coreio.Local); err == nil {
cacheDir = filepath.Join(filepath.Dir(regPath), ".core", "cache")
}