Compare commits

..

No commits in common. "5e90d8f138d77396956b53bfbea01ec23ef64c2b" and "c4ee8e7b046791ebc88ad4b1d6d9ed20ba80f35b" have entirely different histories.

2 changed files with 2 additions and 7 deletions

View file

@ -22,7 +22,7 @@ import (
const ( const (
name string = "agedit" name string = "agedit"
usage string = "Edit age encrypted files with your $EDITOR" usage string = "Edit age encrypted files with your $EDITOR"
version string = "0.2.1" version string = "0.2.0"
help_template string = `NAME: help_template string = `NAME:
{{.Name}} {{if .Version}}v{{.Version}}{{end}} - {{.Usage}} {{.Name}} {{if .Version}}v{{.Version}}{{end}} - {{.Usage}}
@ -210,7 +210,7 @@ func action(ctx *cli.Context) error {
// read from identity file if exists and no identities have been supplied // read from identity file if exists and no identities have been supplied
if !gave_identities { if !gave_identities {
if _, err := os.Stat(cfg.IdentityFile); os.IsNotExist(err) { if _, err := os.Stat(cfg.IdentityFile); os.IsNotExist(err) {
return fmt.Errorf("identity file unset and no identities supplied") 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 { } else {
f, err := os.Open(cfg.IdentityFile) f, err := os.Open(cfg.IdentityFile)
if err != nil { if err != nil {

View file

@ -1,7 +1,6 @@
package editor package editor
import ( import (
"fmt"
"io/fs" "io/fs"
"os" "os"
"os/exec" "os/exec"
@ -19,10 +18,6 @@ type Editor struct {
func (e *Editor) EditFile(filename string) error { func (e *Editor) EditFile(filename string) error {
args := append(e.Args, filename) args := append(e.Args, filename)
if e.Command == "" {
return fmt.Errorf("no editor set or detected")
}
cmd := exec.Command(e.Command, args...) cmd := exec.Command(e.Command, args...)
cmd.Stdin = os.Stdin cmd.Stdin = os.Stdin
cmd.Stdout = os.Stdout cmd.Stdout = os.Stdout