Skip to content

Commit c02d8e3

Browse files
authored
Merge pull request #684 from twpayne/gpgrecipient-warning
Add warnings for features to be deprecated in v2
2 parents cc816d2 + 5e03393 commit c02d8e3

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

cmd/config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ type sourceVCSConfig struct {
3737
AutoCommit bool
3838
AutoPush bool
3939
Init interface{}
40+
NotGit bool
4041
Pull interface{}
4142
}
4243

cmd/root.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package cmd
33
import (
44
"fmt"
55
"os"
6+
"path/filepath"
67
"strings"
78

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

0 commit comments

Comments
 (0)