wip (apply)

This commit is contained in:
2025-10-20 01:35:32 +02:00
parent 8ca8918966
commit a95dd4f3e0
14 changed files with 354 additions and 15 deletions

View File

@@ -4,6 +4,7 @@ import (
"context"
"flag"
"fmt"
"mirror-sync/pkg/client"
"mirror-sync/pkg/project"
"os"
@@ -18,7 +19,7 @@ type (
func (*ApplyCmd) Name() string { return "apply" }
func (*ApplyCmd) Synopsis() string { return "apply the current project settings" }
func (*ApplyCmd) Usage() string {
return `Usage: git-sync apply
return `Usage: mirror-sync apply
apply the current project settings
@@ -35,8 +36,12 @@ func (p *ApplyCmd) Execute(_ context.Context, f *flag.FlagSet, _ ...interface{})
fmt.Fprintf(os.Stderr, "error: %s\n", err)
return subcommands.ExitFailure
}
cli := client.New(projectConfig.ServerURL)
if err := cli.Apply(projectConfig); err != nil {
fmt.Fprintf(os.Stderr, "error: %s\n", err)
return subcommands.ExitFailure
}
return subcommands.ExitSuccess
}