feat: Install plugins directly from Git repositories#126
feat: Install plugins directly from Git repositories#126kubouch merged 12 commits intonushell:mainfrom
Conversation
--git flag on install subcommandfeat: shallow clone depth can be set using `NUPM_GIT_CLONE_DEPTH` env var
|
I think we can support this, but we already support installation of git packages, see https://github.com/nushell/nupm/blob/main/docs/design/registry.md and the Another problem is using This, however, contradicts the PR description which says that it is meant to support installing plugins. Are you sure you meant plugins, not modules? |
|
Hi @kubouch! Thanks for the feedback. About
So the cloned data doesn’t persist under Regarding scope; yes, it supports both modules and plugins, since the logic ultimately (kinda) passes the cloned directory to As for Under the hood, it’s basically doing: let dir = (mktemp --directory)
git clone $repo $dir
nupm install $dir --path |
|
Ah, I get it now. Then instead of |
add `directory` arg to git-clone
|
Updated changes:
|
|
Additionally, note that the new test introduced in this PR fails when there’s no access to GitHub (e.g., in restricted or offline environments). |
|
OK, seems good, thanks! I'm not sure why you refactored those |
This change enhances the plugin installation mechanism by introducing a more flexible Git-based package fetcher.
The new
fetch-package-gitfunction (used via the--gitflag on theinstallsubcommand) enables fetching a package directly from a Git repository into a temporary directory, with support for additional Git options through environment configuration.Key details:
--branchflag allows checking out a specific branch or tag.NUPM_GIT_CLONE_DEPTHenv var (default:1) for faster downloads.NUPM_GIT_CLONE_ARGSenvironment variable, allowing users to pass flags such as--recurse-submodulesor--filterfor advanced cloning scenarios.Effect:
This update removes the need for users to manually clone repositories and install with
--path, or for developers to publish modules to a registry. It simplifies plugin/module installation workflows.Notes:
Additional features such as Git filters, sub-directories, ..., may be added later. For now, the implementation intentionally remains minimal and straightforward.