mirror of
https://github.com/octoleo/restic.git
synced 2024-12-23 11:28:54 +00:00
Skip checking for password file existence if command is 'version' - Issue #1632
This commit is contained in:
parent
ab5ef600a2
commit
b9d643358a
@ -29,14 +29,16 @@ directories in an encrypted repository stored on different backends.
|
|||||||
SilenceUsage: true,
|
SilenceUsage: true,
|
||||||
DisableAutoGenTag: true,
|
DisableAutoGenTag: true,
|
||||||
|
|
||||||
PersistentPreRunE: func(*cobra.Command, []string) error {
|
PersistentPreRunE: func(c *cobra.Command, args []string) error {
|
||||||
// parse extended options
|
// parse extended options
|
||||||
opts, err := options.Parse(globalOptions.Options)
|
opts, err := options.Parse(globalOptions.Options)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
globalOptions.extended = opts
|
globalOptions.extended = opts
|
||||||
|
if c.Name() == "version" {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
pwd, err := resolvePassword(globalOptions, "RESTIC_PASSWORD")
|
pwd, err := resolvePassword(globalOptions, "RESTIC_PASSWORD")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Resolving password failed: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Resolving password failed: %v\n", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user