// SaveMetadata Save the given metadata in the standard location
SaveMetadata Save the given metadata in the standard location
// SaveMetadata Save the given metadata in the standard location
func SaveMetadata(metadata *Metadata) error {
	path, err := install.GetInstallPath()
	if err != nil {
		return err
	}
	os.MkdirAll(path, 0777)
	metadataPath := filepath.Join(path, cliMetadataFile)
	metadataWriter, err := os.Create(metadataPath)
	if err != nil {
		return err
	}
	defer metadataWriter.Close()
	err = json.NewEncoder(metadataWriter).Encode(metadata)
	if err != nil {
		return err
	}
	return nil
}
func SaveMetadata ( metadata * Metadata ) error { path , err := install . GetInstallPath ( ) if err != nil { return err } os . MkdirAll ( path , 0777 ) metadataPath := filepath . Join ( path , cliMetadataFile ) metadataWriter , err := os . Create ( metadataPath ) if err != nil { return err } defer metadataWriter . Close ( ) err = json . NewEncoder ( metadataWriter ) . Encode ( metadata ) if err != nil { return err } return nil }
SaveMetadata Save the given metadata in the standard location
SaveMetadata Save the given metadata in the standard location