From 702f35b319d5df4122038e79a8286a23aa165df2 Mon Sep 17 00:00:00 2001 From: Mariano Cano Date: Thu, 5 Mar 2026 11:13:49 -0800 Subject: [PATCH] Overwrite file when using --force with `step crypto key format` Fix an issue where `step crypto key format` did not overwrite an existing file even when the `--force` flag was provided. Fixes #1579 --- command/crypto/key/format.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/command/crypto/key/format.go b/command/crypto/key/format.go index eac57d36e..4be2f8318 100644 --- a/command/crypto/key/format.go +++ b/command/crypto/key/format.go @@ -13,6 +13,7 @@ import ( "github.com/pkg/errors" "github.com/urfave/cli" + "github.com/smallstep/cli-utils/command" "github.com/smallstep/cli-utils/errs" "github.com/smallstep/cli-utils/fileutil" "github.com/smallstep/cli-utils/ui" @@ -27,7 +28,7 @@ import ( func formatCommand() cli.Command { return cli.Command{ Name: "format", - Action: cli.ActionFunc(formatAction), + Action: command.ActionFunc(formatAction), Usage: `reformat a public or private key`, UsageText: `**step crypto key format** [**--out**=]`, Description: `**step crypto key format** prints or writes the key in