mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-02-13 13:59:06 +02:00
Show a friendly error message when starting lazygit from a non-existent cwd
Closes 3187
This commit is contained in:
parent
d97b37a178
commit
4172be6bc8
@ -27,6 +27,10 @@ func knownError(tr *i18n.TranslationSet, err error) (string, bool) {
|
||||
originalError: "fatal: not a git repository",
|
||||
newError: tr.NotARepository,
|
||||
},
|
||||
{
|
||||
originalError: "getwd: no such file or directory",
|
||||
newError: tr.WorkingDirectoryDoesNotExist,
|
||||
},
|
||||
}
|
||||
|
||||
if mapping, ok := lo.Find(mappings, func(mapping errorMapping) bool {
|
||||
|
@ -335,6 +335,7 @@ type TranslationSet struct {
|
||||
StashIncludeUntrackedChanges string
|
||||
StashOptions string
|
||||
NotARepository string
|
||||
WorkingDirectoryDoesNotExist string
|
||||
Jump string
|
||||
ScrollLeftRight string
|
||||
ScrollLeft string
|
||||
@ -1120,6 +1121,7 @@ func EnglishTranslationSet() TranslationSet {
|
||||
InitialBranch: "Branch name? (leave empty for git's default): ",
|
||||
NoRecentRepositories: "Must open lazygit in a git repository. No valid recent repositories. Exiting.",
|
||||
IncorrectNotARepository: "The value of 'notARepository' is incorrect. It should be one of 'prompt', 'create', 'skip', or 'quit'.",
|
||||
WorkingDirectoryDoesNotExist: "The current working directory does not exist",
|
||||
AutoStashTitle: "Autostash?",
|
||||
AutoStashPrompt: "You must stash and pop your changes to bring them across. Do this automatically? (enter/esc)",
|
||||
StashPrefix: "Auto-stashing changes for ",
|
||||
|
Loading…
x
Reference in New Issue
Block a user