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)
| 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. |
| 305 | func 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 |
| 322 | func copyUIFiles(b *buildingMaterial) (err error) { |
nothing calls this directly
no test coverage detected