iridakos/goto

On zsh, goto is unable to create aliases if ~/.goto does not exist

Calinou opened this issue · 1 comments

  • zsh version: zsh 5.5.1 (x86_64-redhat-linux-gnu) with Prezto
  • goto version: cd760f2

If ~/.goto does not exist, goto is unable to create aliases. It will print an error, claim success but will not effectively save anything:

~/Documents/Git/godotengine/godot
❯ goto -r godot .
_goto_register_alias:34: no such file or directory: /home/hugo/.goto
Alias 'godot' registered successfully.

~/Documents/Git/godotengine/godot
❯ goto -l
You haven't configured any directory aliases yet.

~/Documents/Git/godotengine/godot
❯ goto godot
goto error: unregistered alias godot

This can be worked around by entering touch ~/.goto. Note that this only applies to zsh — it seems to work fine with Bash when ~/.goto does not exist (i.e. the file will be created automatically).

Note that in ZSH there is an excellent and very similar tool called wd which does exactly what goto does

For ZSH / oh-my-zsh: https://github.com/mfaerevaag/wd
For any shell: https://github.com/mfaerevaag/wd-c