From 2c57ab18375a8d0b4df9c4b6d9f3692d14edfee7 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Tue, 28 Jan 2020 01:57:46 -0800 Subject: cmd/fscrypt/setup: don't prompt to create /etc/fscrypt.conf (#190) When 'fscrypt setup' sees that /etc/fscrypt.conf doesn't exist, don't ask for confirmation before creating it. Just do it. This is the normal use, and there's not a good reason to ask the user to confirm it. --- cmd/fscrypt/setup.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cmd/fscrypt/setup.go') diff --git a/cmd/fscrypt/setup.go b/cmd/fscrypt/setup.go index 2bb15ef..69787bb 100644 --- a/cmd/fscrypt/setup.go +++ b/cmd/fscrypt/setup.go @@ -35,7 +35,7 @@ func createGlobalConfig(w io.Writer, path string) error { return ErrMustBeRoot } - // Ask to create or replace the config file + // If the config file already exists, ask to replace it _, err := os.Stat(path) switch { case err == nil: @@ -44,7 +44,7 @@ func createGlobalConfig(w io.Writer, path string) error { err = os.Remove(path) } case os.IsNotExist(err): - err = askConfirmation(fmt.Sprintf("Create %q?", path), true, "") + err = nil } if err != nil { return err -- cgit v1.2.3