@@ -655,7 +655,7 @@ type projectStatus struct {
655
655
Constraints []string
656
656
Source string
657
657
AltSource string
658
- PubVersions []string
658
+ PubVersions map [ string ] []string
659
659
Revision string
660
660
LatestAllowed string
661
661
SourceType string
@@ -711,23 +711,29 @@ func runProjectStatus(ctx *dep.Ctx, args []string, p *dep.Project, sm gps.Source
711
711
// Get the currently selected version from from lock.
712
712
for _ , pl := range p .Lock .Projects () {
713
713
if pr == pl .Ident ().ProjectRoot {
714
+ // VERSION
714
715
projStatus .Version = pl .Version ().String ()
716
+ // SOURCE
715
717
projStatus .Source = projStatus .Project
718
+ // ALT SOURCE
716
719
projStatus .AltSource = pl .Ident ().Source
717
720
718
721
rev , _ , _ := gps .VersionComponentStrings (pl .Version ())
722
+ // REVISION
719
723
projStatus .Revision = rev
720
724
721
725
vcsType , err := sm .GetVcsType (pl .Ident ())
722
726
if err != nil {
723
727
return err
724
728
}
729
+ // SOURCE TYPE
725
730
projStatus .SourceType = vcsType
726
731
727
732
existsUpstream , err := sm .ExistsUpstream (pl .Ident ())
728
733
if err != nil {
729
734
return err
730
735
}
736
+ // UPSTREAM EXISTS
731
737
projStatus .UpstreamExists = existsUpstream
732
738
733
739
// Update local copy of the source and then fetch all the versions.
@@ -737,6 +743,7 @@ func runProjectStatus(ctx *dep.Ctx, args []string, p *dep.Project, sm gps.Source
737
743
return err
738
744
}
739
745
746
+ // UPSTREAM VERSION EXISTS
740
747
for _ , pv := range pvs {
741
748
if pv .Unpair ().String () == pl .Version ().String () {
742
749
projStatus .UpstreamVersionExists = true
@@ -749,9 +756,27 @@ func runProjectStatus(ctx *dep.Ctx, args []string, p *dep.Project, sm gps.Source
749
756
return err
750
757
}
751
758
759
+ // PACKAGES
752
760
for pkgPath := range pkgtree .Packages {
753
761
projStatus .Packages = append (projStatus .Packages , pkgPath )
754
762
}
763
+
764
+ // PUB VERSION
765
+ var semvers , branches , nonsemvers []string
766
+ for _ , pv := range pvs {
767
+ switch pv .Type () {
768
+ case gps .IsSemver :
769
+ semvers = append (semvers , pv .Unpair ().String ())
770
+ case gps .IsBranch :
771
+ branches = append (branches , pv .Unpair ().String ())
772
+ default :
773
+ nonsemvers = append (nonsemvers , pv .Unpair ().String ())
774
+ }
775
+ }
776
+ projStatus .PubVersions = make (map [string ][]string )
777
+ projStatus .PubVersions ["semver" ] = semvers
778
+ projStatus .PubVersions ["branches" ] = branches
779
+ projStatus .PubVersions ["nonsemvers" ] = nonsemvers
755
780
}
756
781
}
757
782
0 commit comments