mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-02 04:50:49 +00:00
Add -json flag to publish list|show
Signed-off-by: Joshua Colson <joshua.colson@gmail.com>
This commit is contained in:
committed by
Lorenzo Bolla
parent
129eb8644d
commit
899ed92ebc
+13
-1
@@ -282,7 +282,7 @@ func NewPublishedRepo(storage, prefix, distribution string, architectures []stri
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// MarshalJSON requires object to be "loeaded completely"
|
||||
// MarshalJSON requires object to be "loaded completely"
|
||||
func (p *PublishedRepo) MarshalJSON() ([]byte, error) {
|
||||
type sourceInfo struct {
|
||||
Component, Name string
|
||||
@@ -313,6 +313,7 @@ func (p *PublishedRepo) MarshalJSON() ([]byte, error) {
|
||||
"NotAutomatic": p.NotAutomatic,
|
||||
"ButAutomaticUpgrades": p.ButAutomaticUpgrades,
|
||||
"Prefix": p.Prefix,
|
||||
"Path": p.GetPath(),
|
||||
"SourceKind": p.SourceKind,
|
||||
"Sources": sources,
|
||||
"Storage": p.Storage,
|
||||
@@ -491,6 +492,17 @@ func (p *PublishedRepo) GetLabel() string {
|
||||
return p.Label
|
||||
}
|
||||
|
||||
// GetName returns the unique name of the repo
|
||||
func (p *PublishedRepo) GetPath() string {
|
||||
prefix := p.StoragePrefix()
|
||||
|
||||
if prefix == "" {
|
||||
return p.Distribution
|
||||
}
|
||||
|
||||
return fmt.Sprintf("%s/%s", prefix, p.Distribution)
|
||||
}
|
||||
|
||||
// GetSuite returns default or manual Suite:
|
||||
func (p *PublishedRepo) GetSuite() string {
|
||||
if p.Suite == "" {
|
||||
|
||||
Reference in New Issue
Block a user