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

some ideas for nupm update #14

Open
amtoine opened this issue Sep 4, 2023 · 1 comment
Open

some ideas for nupm update #14

amtoine opened this issue Sep 4, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@amtoine
Copy link
Member

amtoine commented Sep 4, 2023

i just wanted to throw this script in there, in case it can give inspiration to someone to write nupm update 🙏

# install a Nushell package without installing `nupm`
def nupm-install [
    package: path,  # the path to the local package to install
    --log-level: string = "DEBUG"  # the log level for the install
    --nupm: path,  # the path to the `nupm`'s directory
]: nothing -> nothing {
    nu --commands $"
        use ($nupm)
        NU_LOG_LEVEL=($log_level) nupm install --path ($package)
    "
}

alias "nupm install" = nupm-install --nupm (
    $env.GIT_REPOS_HOME | path join "github.com" "nushell" "nupm" "nupm"
)

def "nupm update" [repos: list<string>]: nothing -> nothing {
    for repo in $repos {
        let package = $env.GIT_REPOS_HOME | path join $repo

        git -C $package pull origin main
        nupm install $package
    }
}
nupm update [
    "github.com/goatfiles/scripts/nu_scripts"
    "github.com/amtoine/nu-git-manager"
    "github.com/amtoine/zellij-layouts/nu-zellij"
    "github.com/nushell/nu_scripts"
]
@amtoine amtoine added the enhancement New feature or request label Oct 11, 2023
@vyadh
Copy link
Contributor

vyadh commented Jan 23, 2025

I'm assuming this would need to work from Git tags on the module repo and those that are recognised as version numbers? So, updating everything to "latest" would infer what is latest based on semver comparisons presumably.

Once we have a dependencies file, it would need to be two operations I guess, one to update based on dependencies changed in the file by the user and another to discover what the latest versions are and apply them to the file ... But that's a tomorrow problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants