format plugins dir name from dash to underline
(dirPath string)
| 559 | |
| 560 | // format plugins dir name from dash to underline |
| 561 | func formatUIPluginsDirName(dirPath string) { |
| 562 | entries, err := os.ReadDir(dirPath) |
| 563 | if err != nil { |
| 564 | fmt.Printf("read ui plugins dir failed: [%s] %s\n", dirPath, err) |
| 565 | return |
| 566 | } |
| 567 | for _, entry := range entries { |
| 568 | if !entry.IsDir() || !strings.Contains(entry.Name(), "-") { |
| 569 | continue |
| 570 | } |
| 571 | newName := strings.ReplaceAll(entry.Name(), "-", "_") |
| 572 | if err := os.Rename(filepath.Join(dirPath, entry.Name()), filepath.Join(dirPath, newName)); err != nil { |
| 573 | fmt.Printf("rename ui plugins dir failed: [%s] %s\n", dirPath, err) |
| 574 | } else { |
| 575 | fmt.Printf("rename ui plugins dir success: [%s] -> [%s]\n", entry.Name(), newName) |
| 576 | } |
| 577 | } |
| 578 | } |
| 579 | |
| 580 | // buildBinary build binary file |
| 581 | func buildBinary(b *buildingMaterial) (err error) { |