MCPcopy Index your code
hub / github.com/apache/answer / movePluginToVendor

Function movePluginToVendor

internal/cli/build.go:305–319  ·  view source on GitHub ↗

movePluginToVendor move plugin to vendor dir Traverse the plugins, and if the plugin path is not github.com/apache/answer-plugins, move the contents of the current plugin to the vendor/github.com/apache/answer-plugins/ directory.

(b *buildingMaterial)

Source from the content-addressed store, hash-verified

303// movePluginToVendor move plugin to vendor dir
304// Traverse the plugins, and if the plugin path is not github.com/apache/answer-plugins, move the contents of the current plugin to the vendor/github.com/apache/answer-plugins/ directory.
305func movePluginToVendor(b *buildingMaterial) (err error) {
306 pluginsDir := filepath.Join(b.tmpDir, "vendor/github.com/apache/answer-plugins/")
307 for _, p := range b.plugins {
308 pluginDir := filepath.Join(b.tmpDir, "vendor/", p.Name)
309 pluginName := filepath.Base(p.Name)
310 if !strings.HasPrefix(p.Name, "github.com/apache/answer-plugins/") {
311 fmt.Printf("try to copy dir from %s to %s\n", pluginDir, filepath.Join(pluginsDir, pluginName))
312 err = copyDirEntries(os.DirFS(pluginDir), ".", filepath.Join(pluginsDir, pluginName), "node_modules")
313 if err != nil {
314 return err
315 }
316 }
317 }
318 return nil
319}
320
321// copyUIFiles copy ui files from answer module to tmp dir
322func copyUIFiles(b *buildingMaterial) (err error) {

Callers

nothing calls this directly

Calls 1

copyDirEntriesFunction · 0.85

Tested by

no test coverage detected