mirror of
https://github.com/Yuyi-Oak/BlueArchiveToolkit.git
synced 2026-09-18 10:54:55 +08:00
27 lines
406 B
Go
27 lines
406 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
)
|
|
|
|
func runSync(args []string) error {
|
|
if len(args) < 2 || args[0] != "plan" {
|
|
return fmt.Errorf("usage: bat sync plan <current-json> [previous-json]")
|
|
}
|
|
|
|
current := args[1]
|
|
previous := ""
|
|
if len(args) > 2 {
|
|
previous = args[2]
|
|
}
|
|
|
|
result, err := BuildSyncPlan(current, previous)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
fmt.Fprintln(os.Stdout, result)
|
|
return nil
|
|
}
|