check / check (pull_request) Failing after 0s
script/docker now computes the version (via script/version), commit and build date on the host and passes them as build args; the Dockerfile no longer runs git, which always returned "unknown" because the build context excludes .git. A dirty tree is reflected through script/version's -dirty suffix. main now exits via os.Exit(run()), so its deferred CPU/heap profile writers flush before the process ends, and Entry returns a status code instead of calling os.Exit. Each command ran its operation in an fx goroutine that called os.Exit(1) on failure, discarding those profiles and the PID-lock release; they now route the error to the return path through one RunOperation helper. errReported keeps Entry from printing an already-reported failure twice. model: claude-opus-4-8
49 lines
1.3 KiB
Go
49 lines
1.3 KiB
Go
package cli
|
|
|
|
import (
|
|
"github.com/spf13/cobra"
|
|
"sneak.berlin/go/vaultik/internal/log"
|
|
"sneak.berlin/go/vaultik/internal/vaultik"
|
|
)
|
|
|
|
// NewInfoCommand creates the info command
|
|
func NewInfoCommand() *cobra.Command {
|
|
cmd := &cobra.Command{
|
|
Use: "info",
|
|
Short: "Display system and configuration information",
|
|
Long: `Shows information about the current vaultik configuration, including:
|
|
- System details (OS, architecture, version)
|
|
- Storage configuration (S3 bucket, endpoint)
|
|
- Backup settings (source directories, compression)
|
|
- Encryption configuration (recipients)
|
|
- Local database statistics`,
|
|
Args: cobra.NoArgs,
|
|
RunE: func(cmd *cobra.Command, _ []string) error {
|
|
// Use unified config resolution
|
|
configPath, err := ResolveConfigPath()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
// Use the app framework
|
|
rootFlags := GetRootFlags()
|
|
|
|
return RunOperation(cmd.Context(), AppOptions{
|
|
ConfigPath: configPath,
|
|
LogOptions: log.Options{
|
|
Verbose: rootFlags.Verbose,
|
|
Debug: rootFlags.Debug,
|
|
Quiet: rootFlags.Quiet,
|
|
},
|
|
}, func(v *vaultik.Vaultik) error {
|
|
return v.ShowInfo()
|
|
}, func(err error) {
|
|
log.Error("Failed to show info", "error", err)
|
|
ReportErrorf("Failed to show info: %v", err)
|
|
})
|
|
},
|
|
}
|
|
|
|
return cmd
|
|
}
|