Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mv: cannot stat `~/.local/share/dasht/docsets/Express.docset': No such file or directory #6

Closed
netei opened this issue Mar 9, 2016 · 4 comments

Comments

@netei
Copy link
Contributor

netei commented Mar 9, 2016

When running the command dasht-docsets-install express

And pressing yes, I get the error specified in the title.

I'm using the latest master version (26ced75)

After bisecting (with rm ~/.local/share/dasht/docsets/Express.* -rf ; dasht-docsets-install express), I found out the first bad commit : 5408885

I don't have any of the XDG env variables set ( env | grep --color -E 'XDG' | wc -l returns 0)

@netei
Copy link
Contributor Author

netei commented Mar 9, 2016

The condition here :

5408885#diff-fa4243a5cc4c7cbfbe63937ca8ca41edR64

Is causing the issue

test "$have" = "$want" || test -d "$want" && mv "$want" "$have"

It seams strange to me but they doesn't seem to be any precedence here , for example If I do :

test "1" = "1" || echo "foo" && echo "bar"

I get "bar".

I think what you would like to do is :

test "$have" = "$want" || { test -d "$want" && mv "$want" "$have" ; }

@netei
Copy link
Contributor Author

netei commented Mar 9, 2016

Maybe it is because my sh is symlinked to bash ls -lah $(which sh) gives lrwxrwxrwx 1 root root 4 Dec 14 11:22 /bin/sh -> bash , or is this the case on all machines nowadays ?

netei added a commit to netei/dasht that referenced this issue Mar 9, 2016
@sunaku
Copy link
Owner

sunaku commented Mar 9, 2016

Thanks for your bug report and fix! 👍

:neckbeard: /bin/sh does not universally mean Bash. For instance, in Debian and Ubuntu, it's the Dash shell.

sunaku pushed a commit that referenced this issue Mar 9, 2016
The POSIX shell language manual describes short-circuit evaluation thus:

    The operators "&&" and "||" shall have equal precedence and shall be
    evaluated with left associativity. For example, both of the
    following commands write solely bar to standard output:

    false && echo foo || echo bar
    true || echo foo && echo bar

http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_03
@sunaku
Copy link
Owner

sunaku commented Mar 9, 2016

Fixed in master branch at commit 92fc97d. 🙇

@sunaku sunaku closed this as completed Mar 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants