Compare commits

..

No commits in common. "26b6a2d3498ca9e51b520fd953111aa0002398f2" and "78d3fe54b532084d4fbc9a117a893accea28cfc7" have entirely different histories.

2 changed files with 11 additions and 14 deletions

View file

@ -21,7 +21,7 @@ import (
const (
name string = "agedit"
usage string = "Edit age encrypted files with your $EDITOR"
version string = "0.1.1"
version string = "0.1.0"
help_template string = `NAME:
{{.Name}} {{if .Version}}v{{.Version}}{{end}} - {{.Usage}}
@ -60,7 +60,6 @@ var (
identities = append(identities, id)
}
gave_identities = true
return nil
},
},
@ -88,7 +87,6 @@ var (
}
recipients = append(recipients, r)
}
gave_recipients = true
return nil
},
},
@ -206,7 +204,7 @@ func action(ctx *cli.Context) error {
}
// read from identity file if exists and no identities have been supplied
if !gave_identities {
if len(identities) == 0 {
if _, err := os.Stat(cfg.IdentityFile); os.IsNotExist(err) {
return fmt.Errorf("identity file unset and no identities supplied, use -i to specify an idenitity file or set one in the config file, or use -I to specify an age private key")
} else {
@ -223,7 +221,7 @@ func action(ctx *cli.Context) error {
}
// read from recipient file if it exists and no recipients have been supplied
if !gave_recipients && cfg.RecipientFile != "" {
if len(recipients) == 0 {
if _, err := os.Stat(cfg.RecipientFile); os.IsNotExist(err) {
return fmt.Errorf("recipient file doesn't exist")
} else {

View file

@ -12,15 +12,14 @@ import (
)
var (
identities []age.Identity
recipients []age.Recipient
logger *log.Logger
cfg config.Config
edt editor.Editor
configFile string
input_file, output_file string
force_overwrite bool
gave_identities, gave_recipients bool
identities []age.Identity
recipients []age.Recipient
logger *log.Logger
cfg config.Config
edt editor.Editor
configFile string
input_file, output_file string
force_overwrite bool
)
func main() {