mu: reinitialize when personal addresses change

When the user changes which addresses mu should consider 'personal',
mu's store should be reinitialized.

After this change, the activation script parses the previously
configured list of addresses and compares it with the new one. If they
differ, it runs the init command even when the store has already been
initialized.
This commit is contained in:
VojtechStep 2024-11-18 17:35:56 +01:00 committed by Robert Helgesson
parent 8bea1a2005
commit 7349b01505
No known key found for this signature in database
GPG key ID: 96E745BD17AA17ED
2 changed files with 22 additions and 12 deletions

View file

@ -16,9 +16,9 @@
nmt.script = ''
assertFileContains activate \
'if [[ ! -d "/home/hm-user/.cache/mu" ]]; then'
'if [[ ! -d "/home/hm-user/.cache/mu" || ! "$MU_SORTED_ADDRS" = "foo@example.com hm@example.com" ]]; then'
assertFileContains activate \
'run @mu@/bin/mu init --maildir=/home/hm-user/Mail --my-address=hm@example.com --my-address=foo@example.com $VERBOSE_ARG;'
'run @mu@/bin/mu init --maildir=/home/hm-user/Mail --my-address=foo@example.com --my-address=hm@example.com $VERBOSE_ARG;'
'';
}