@ -211,18 +211,12 @@ func (pr Requirement) ListInstallations(opts ListInstallationsOptions) (InstallL
}
}
desc Out, err := exec . Command ( path , "describe" ) . Output ( )
desc ribeInfo, err := GetPluginDescription ( path )
if err != nil {
log . Printf ( " couldn't call describe on %q, ignoring", path )
log . Printf ( " failed to call describe on %q: %s", path , err )
continue
}
var describeInfo pluginsdk . SetDescription
err = json . Unmarshal ( descOut , & describeInfo )
if err != nil {
log . Printf ( "%q: describe output deserialization error %q, ignoring" , path , err )
}
// versionsStr now looks like v1.2.3_x5.1 or amazon_v1.2.3_x5.1
parts := strings . SplitN ( versionsStr , "_" , 2 )
pluginVersionStr , protocolVersionStr := parts [ 0 ] , parts [ 1 ]
@ -933,6 +927,18 @@ func (pr *Requirement) InstallLatest(opts InstallOptions) (*Installation, error)
return nil , errs
}
func GetPluginDescription ( pluginPath string ) ( pluginsdk . SetDescription , error ) {
out , err := exec . Command ( pluginPath , "describe" ) . Output ( )
if err != nil {
return pluginsdk . SetDescription { } , err
}
desc := pluginsdk . SetDescription { }
err = json . Unmarshal ( out , & desc )
return desc , err
}
func init ( ) {
var err error
// Should never error if both components are set