Skip to content

Add '-f' flag to 'volt list' to inspect internal information #162

@tyru

Description

@tyru

via #64

Basic feature

volt list -f can access and show information of lock.json structure.

Example

Show all repositories:

$ volt list -f '{{ range .Repos }}{{ println .Path }}{{ end }}'

Show repositories used by current profile:

$ volt list -f '{{ range .Profiles }}{{ if eq $.CurrentProfileName .Name }}{{ range .ReposPath }}{{ println . }}{{ end }}{{ end }}{{ end }}'

Functions

Some useful functions are defined by volt.

currentProfile (profile)

This accesses to current profile.
So above code (Show repositories used by current profile) can be written like this:

$ volt list -f '{{ range currentProfile.ReposPath }}{{ println . }}{{ end }}'

profile name (profile)

Returns given name's profile.

json value [prefix [indent]] (string)

Returns JSON representation of value.
The arguments are same as json.MarshalIndent().

version (string)

format: "v{major}.{minor}.{patch}"

versionMajor (number)

versionMinor (number)

versionPatch (number)

major/minor/patch version number

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions