volta-cli/volta

`volta list` output is wrong for locally-installed tools

Open

#711 aperta il 16 apr 2020

Vedi su GitHub
 (5 commenti) (1 reazione) (0 assegnatari)Rust (189 fork)batch import
buggood first issue

Metriche repository

Star
 (8309 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

In a project with a given tool installed locally (in this case, ember-cli)—

  • Expected:

    $ volta list
    
    ⚡️ Currently active tools:
    
        Node: v12.16.2 (current @ /Users/chris/dev/test/foo/package.json)
        Yarn: v1.22.4 (current @ /Users/chris/dev/test/foo/package.json)
        Tool binaries available:
            ember (current @ /Users/chris/dev/test/foo/package.json)
    
  • Actual:

    $ volta list
    
    ⚡️ Currently active tools:
    
        Node: v12.16.2 (current @ /Users/chris/dev/test/foo/package.json)
        Yarn: v1.22.4 (current @ /Users/chris/dev/test/foo/package.json)
        Tool binaries available:
            ember (default)
    

Additionally, we currently report the wrong platform values for these. In the extended form (volta list all):

  • Expected:

    ember-cli@3.17.0 (current @ /Users/chris/dev/test/foo/package.json)
        binary tools: ember
        platform:
            runtime: node@12.16.2 (current @ /Users/chris/dev/test/foo/package.json)
            package manager: yarn@1.22.4 (current @ /Users/chris/dev/test/foo/package.json)
    
  • Actual:

    ember-cli@3.17.0 (default)
        binary tools: ember
        platform:
            runtime: node@12.16.2
            package manager: npm@built-in
    

This correctly reports the Node version (though without the current @ ... from the design), but not the correct package manager version.

This affects both the --format=plain and the --format=human variants, which is expected: the underlying logic for both is identical.

Guida contributor