Fix warning in p_install_gh when installing multiple packages#122
Open
LoHertel wants to merge 1 commit intotrinker:masterfrom
Open
Fix warning in p_install_gh when installing multiple packages#122LoHertel wants to merge 1 commit intotrinker:masterfrom
p_install_gh when installing multiple packages#122LoHertel wants to merge 1 commit intotrinker:masterfrom
Conversation
p_install_gh installes multiple packages without warningp_install_gh when installing multiple packages
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.
This PR addresses the warning message mentioned in #118 when installing multiple packages with
p_install_gh().The code in
R/p_install_gh.R#L24throws a warning message when passing a vector of repository names to thepackageargument:p_install_gh(c('path/package', 'path2/repo'))I propose the following changes:
p_loaded()is using the package name to check, whether that package is loaded, the package name should be extracted from the Github path beforehand withparse_git_repo(). (Becausep_install_gh()passes a Github path (e.g. 'trinker/pacman') top_loaded().p_loaded()always returnsFALSEfor Github paths.)parse_git_repo()inR/utils.R#L194from theremotespackage. It would act as an interface to call eitherremotes::parse_github_url()orremotes::parse_repo_spec(). The code forparse_git_repo()is taken fromremotes/R/parse-git.R#L97.parse_git_repo()depends onviapply(), therefore it is included fromremotes/R/utils.R#L8as well.