MCPcopy
hub / github.com/SurgeDM/Surge / queueInitialRootDownloads

Function queueInitialRootDownloads

cmd/root.go:429–450  ·  view source on GitHub ↗
(args []string, opts rootRunOptions)

Source from the content-addressed store, hash-verified

427}
428
429func queueInitialRootDownloads(args []string, opts rootRunOptions) {
430 atomic.AddInt32(&pendingEnqueue, 1)
431 go func() {
432 defer atomic.AddInt32(&pendingEnqueue, -1)
433 var urls []string
434 urls = append(urls, args...)
435
436 if opts.batchFile != "" {
437 fileURLs, err := utils.ReadURLsFromFile(opts.batchFile)
438 if err != nil {
439 fmt.Fprintf(os.Stderr, "Error reading batch file: %v\n", err)
440 } else {
441 urls = append(urls, fileURLs...)
442 }
443 }
444
445 if len(urls) > 0 {
446 resolvedOutputDir := resolveClientOutputPath(opts.outputDir)
447 processDownloads(urls, resolvedOutputDir, 0) // 0 port = internal direct add
448 }
449 }()
450}
451
452// rootCmd represents the base command when called without any subcommands
453var rootCmd = &cobra.Command{

Callers 2

startServerLogicFunction · 0.85
root.goFile · 0.85

Calls 3

ReadURLsFromFileFunction · 0.92
resolveClientOutputPathFunction · 0.85
processDownloadsFunction · 0.85

Tested by

no test coverage detected