// Copyright 2017-2025 WIT.COM Inc. All rights reserved. // Use of this source code is governed by the GPL 3.0 package main import ( "strings" "go.wit.com/lib/config" "go.wit.com/lib/gui/shell" "go.wit.com/log" ) // // go-clone everything from wit // func doClone() error { initForge() data, err := resources.ReadFile("resources/repomap") if err != nil { log.Info("open repomap failed", err) return err } if len(data) == 0 { log.Info("resources/repomap is empty") return config.ErrEmpty } for _, line := range strings.Split(string(data), "\n") { if line == "" { continue } if strings.HasPrefix(line, "#") { continue } parts := strings.Fields(line) gopath := parts[0] repo := me.forge.Repos.FindByNamespace(gopath) if repo != nil { if argv.Verbose { log.Info("already have", repo.FullPath) } continue } var cmd []string cmd = []string{"go-clone", "--non-recursive", gopath} if argv.DryRun { log.Info("run:", cmd) } else { log.Info("should run:", cmd) if _, err := shell.RunRealtimeError(cmd); err != nil { if !argv.Force { badExit(err) } } } } return nil }