nushell / nupm

A manager for Nushell packages.
MIT License
174 stars 12 forks source link

nupm - Nushell package manager

Table of content

:warning: This project is in an experimentation stage and not intended for serious use! :warning:

:recycle: installation [toc]

Important nupm might use the latest Nushell language features that have not been released in the latest version yet. If that is the case, consider building Nushell from the main branch, or installing the nightly build.

nupm is a module. Download the repository and treat the nupm directory as a module. For example:

Note nupm is able to install itself: from inside the root of your local copy of nupm, run

use nupm/
nupm install --force --path .

:gear: configuration [toc]

One can change the location of the Nupm directory with $env.NUPM_HOME, e.g.

# env.nu

$env.NUPM_HOME = ($env.XDG_DATA_HOME | path join "nupm")

Because Nupm will install modules and scripts in {{nupm-home}}/modules/ and {{nupm-home}}/scripts/ respectively, it is a good idea to add these paths to $env.NU_LIB_DIRS and $env.PATH respectively, e.g. if you have $env.NUPM_HOME defined:

# env.nu

$env.NU_LIB_DIRS = [
    ...
    ($env.NUPM_HOME | path join "modules")
]

$env.PATH = (
    $env.PATH
        | split row (char esep)
        | ....
        | prepend ($env.NUPM_HOME | path join "scripts")
        | uniq
)

:test_tube: running a test suite [toc]

as it is done in Nupm, one can define tests in a project and run them with the nupm test command:

run the tests of Nupm [toc]

from the root of Nupm, run

nupm test

you should see something like

Testing package /home/amtoine/documents/repos/github.com/amtoine/nupm
tests install-module ... SUCCESS
tests install-script ... SUCCESS
tests install-custom ... SUCCESS
Ran 3 tests. 3 succeeded, 0 failed.

:memo: design of nupm [toc]

please have a look at the design document