mirror of
https://git.sr.ht/~rjarry/aerc
synced 2026-03-02 18:23:33 +01:00
template: pass account and folder names to signature command
This can help to dynamically determine what signature you want. Changelog-added: `AERC_ACCOUNT` and `AERC_FOLDER` are now available in the signature command environment. Signed-off-by: Tristan Partin <tristan@partin.io> Acked-by: Robin Jarry <robin@jarry.cc>
This commit is contained in:
committed by
Robin Jarry
parent
e35c193db1
commit
da5ca1a530
@@ -713,6 +713,10 @@ func (d *templateData) Signature() string {
|
||||
func (d *templateData) readSignatureFromCmd() ([]byte, error) {
|
||||
sigCmd := d.account.SignatureCmd
|
||||
cmd := exec.Command("sh", "-c", sigCmd)
|
||||
env := os.Environ()
|
||||
env = append(env, fmt.Sprintf("AERC_ACCOUNT=%s", d.account.Name))
|
||||
env = append(env, fmt.Sprintf("AERC_FOLDER=%s", d.folder.Name))
|
||||
cmd.Env = env
|
||||
signature, err := cmd.Output()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user