feat: refact syncrepo using go
This commit is contained in:
@@ -1,7 +1,28 @@
|
||||
package main
|
||||
|
||||
import "github.com/engigu/baihu-panel/internal/bootstrap"
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/engigu/baihu-panel/cmd/reposync"
|
||||
"github.com/engigu/baihu-panel/internal/bootstrap"
|
||||
)
|
||||
|
||||
func main() {
|
||||
bootstrap.New().Run()
|
||||
if len(os.Args) < 2 {
|
||||
bootstrap.New().Run()
|
||||
return
|
||||
}
|
||||
|
||||
cmd := os.Args[1]
|
||||
switch cmd {
|
||||
case "server":
|
||||
bootstrap.New().Run()
|
||||
case "reposync":
|
||||
reposync.Run(os.Args[2:])
|
||||
default:
|
||||
fmt.Printf("Unknown command: %s\n", cmd)
|
||||
fmt.Println("Available commands: server, reposync")
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user