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

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

Closed
tyru opened this issue Jan 2, 2018 · 0 comments
Closed

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

tyru opened this issue Jan 2, 2018 · 0 comments

Comments

@tyru
Copy link
Member

tyru commented Jan 2, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant