Skip to content

Commit

Permalink
Merge pull request #684 from twpayne/gpgrecipient-warning
Browse files Browse the repository at this point in the history
Add warnings for features to be deprecated in v2
  • Loading branch information
twpayne committed Apr 18, 2020
2 parents cc816d2 + 5e03393 commit c02d8e3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ type sourceVCSConfig struct {
AutoCommit bool
AutoPush bool
Init interface{}
NotGit bool
Pull interface{}
}

Expand Down
14 changes: 14 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cmd
import (
"fmt"
"os"
"path/filepath"
"strings"

"github.com/coreos/go-semver/semver"
Expand Down Expand Up @@ -87,6 +88,19 @@ func init() {
if config.err != nil {
rootCmd.Printf("warning: %s: %v\n", config.configFile, config.err)
}
if config.GPGRecipient != "" {
rootCmd.Printf("" +
"warning: your config file uses gpgRecipient which will be deprecated in v2\n" +
"warning: to disable this warning, set gpg.recipient in your config file instead\n",
)
}
if config.SourceVCS.Command != "" && !config.SourceVCS.NotGit && !strings.Contains(filepath.Base(config.SourceVCS.Command), "git") {
rootCmd.Printf("" +
"warning: it looks like you are using a version control system that is not git which will be deprecated in v2\n" +
"warning: please report this at https://github.com/twpayne/chezmoi/issues/459\n" +
"warning: to disable this warning, set sourceVCS.notGit = true in your config file\n",
)
}
case os.IsNotExist(err):
default:
printErrorAndExit(err)
Expand Down

0 comments on commit c02d8e3

Please sign in to comment.