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 · 0 comments
Open

some ideas for nupm update #14

amtoine opened this issue Sep 4, 2023 · 0 comments
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
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

1 participant