Fix plugin-update --all when there are no plugins#803
Merged
Stratus3D merged 1 commit intoasdf-vm:masterfrom Sep 18, 2020
Merged
Fix plugin-update --all when there are no plugins#803Stratus3D merged 1 commit intoasdf-vm:masterfrom
Stratus3D merged 1 commit intoasdf-vm:masterfrom
Conversation
Issue: when asdf is first installed, there are no plugins, and running `asdf plugin-update --all` crashes because the plugin directory doesn't exist; similarly, the command crashes if the plugins directory exists yet doesn't contain any subdirectories. Solution: This patch changes the directory loop from using a wildcard `plugins/*` to a more robust approach: first verify the plugins directory exists, then use the`find` command to list subdirectories and correctly handle the corner case of no subdirectories. Future: Consider printing an error message and/or advice message. Consider automatically creating the plugins directory as needed. Consider prompting the user to install some popular plugins.
Stratus3D
reviewed
Sep 17, 2020
| (cd "$dir" && git fetch -p -u origin "$gitref:$gitref" && git checkout -f "$gitref") | ||
| done | ||
| if [ -d "$(asdf_data_dir)"/plugins ]; then | ||
| for dir in $(find "$(asdf_data_dir)"/plugins -type d -mindepth 1 -maxdepth 1); |
Member
There was a problem hiding this comment.
You are missing the do keyword on this line.
Member
|
Thanks for the PR! I have addressed the syntax errors and merged your changes into master. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue: when asdf is first installed, there are no plugins, and running
asdf plugin-update --allcrashes because the plugin directory doesn't exist; similarly, the command crashes if the plugins directory exists yet doesn't contain any subdirectories.Solution: This patch changes the directory loop from using a wildcard
plugins/*to a more robust approach: first verify the plugins directory exists, then use thefindcommand to list subdirectories and correctly handle the corner case of no subdirectories.Future: Consider printing an error message and/or advice message. Consider automatically creating the plugins directory as needed. Consider prompting the user to install some popular plugins.
Summary
Provide a general description of the code changes in your pull request.
Fixes: List issue numbers here
Other Information
If there is anything else that is relevant to your pull request include that
information here.
Thank you for contributing to asdf!