mirror of
https://github.com/SagerNet/sing-box.git
synced 2025-02-06 00:10:38 +00:00
Fix rule-set upgrade command
This commit is contained in:
parent
08c1ec4b7e
commit
eeb37d89f1
|
@ -61,14 +61,15 @@ func upgradeRuleSet(sourcePath string) error {
|
|||
log.Info("already up-to-date")
|
||||
return nil
|
||||
}
|
||||
plainRuleSet, err := plainRuleSetCompat.Upgrade()
|
||||
plainRuleSetCompat.Options, err = plainRuleSetCompat.Upgrade()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
plainRuleSetCompat.Version = C.RuleSetVersionCurrent
|
||||
buffer := new(bytes.Buffer)
|
||||
encoder := json.NewEncoder(buffer)
|
||||
encoder.SetIndent("", " ")
|
||||
err = encoder.Encode(plainRuleSet)
|
||||
err = encoder.Encode(plainRuleSetCompat)
|
||||
if err != nil {
|
||||
return E.Cause(err, "encode config")
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue