Improve error message display when autoinit fails

Due to eg, a permissions problem.
This commit is contained in:
Joey Hess 2021-12-09 14:38:12 -04:00
parent a62f2e141b
commit dbba231e06
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
3 changed files with 9 additions and 1 deletions

View file

@ -200,7 +200,10 @@ ensureInitialized = getInitializedVersion >>= maybe needsinit checkUpgrade
where
needsinit = ifM autoInitializeAllowed
( do
initialize True Nothing Nothing
tryNonAsync (initialize True Nothing Nothing) >>= \case
Right () -> noop
Left e -> giveup $ show e ++ "\n" ++
"git-annex: automatic initialization failed due to above problems"
autoEnableSpecialRemotes
, giveup "First run: git-annex init"
)