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

Install script can abort on mkdir #113

Closed
solarizedalias opened this issue Oct 20, 2020 · 2 comments
Closed

Install script can abort on mkdir #113

solarizedalias opened this issue Oct 20, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@solarizedalias
Copy link

Describe the bug

Currently, install.sh (invoked by doge#install()) can fail if $ROOT_DIR/bin already exists (e.g. when users try to update the plugin). This happens because mkdir ./bin returns non-zero when the directory exists and set -e causes the entire script to abort, therefore results in empty bin directory (the binary, if exists, is removed every time the script runs).

Settings

To Reproduce
Run call doge#install() or scripts/install.sh more than one time.

Expected behavior
The script does not abort and the binary vim-doge is installed in bin properly.

@solarizedalias solarizedalias added the bug Something isn't working label Oct 20, 2020
@kkoomen
Copy link
Owner

kkoomen commented Oct 20, 2020

I don't know which system you're running, but I don't have this problem on OSX, but I did add a check now. Shouldn't have this issue again in v3.3.1. Let me know if it's fixed for you or not.

@kkoomen kkoomen closed this as completed Oct 20, 2020
@solarizedalias
Copy link
Author

Thank you, looks like it's solved.
Updated the plugin and confirmed doge#install() or running install.sh downloads the latest binary each time they run.

It's strange because I also use macOS (mojave), I tried in two versions of mkdir, /bin/mkdir and coreutils mkdir installed by homebrew by modifying PATH, which in this case behaved the same way. mkdir: cannot create directory ‘./bin’: File exists

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants