Skip to content

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

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

Activity

  1. added 2 commits that reference this issue on Jan 2, 2018
    90a1f0f
    c9f83bd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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