func (dir *CharmDir) ArchiveTo(w io.Writer) error {
	ignoreRules, err := dir.buildIgnoreRules()
	if err != nil {
		return err
	}
	// We update the version to make sure we don't lag behind
	dir.version, _, err = dir.MaybeGenerateVersionString(logger)
	if err != nil {
		// We don't want to stop, even if the version cannot be generated
		logger.Warningf("trying to generate version string: %v", err)
	}

	return writeArchive(w, dir.Path, dir.revision, dir.version, dir.Meta().Hooks(), ignoreRules)
}
// ArchiveTo creates a charm file from the charm expanded in dir.
// By convention a charm archive should have a ".charm" suffix.
ArchiveTo creates a charm file from the charm expanded in dir.
By convention a charm archive should have a ".charm" suffix.
// ArchiveTo creates a charm file from the charm expanded in dir . // By convention a charm archive should have a " . charm " suffix .
func (dir *CharmDir) ArchiveTo(w io.Writer) error {
	ignoreRules, err := dir.buildIgnoreRules()
	if err != nil {
		return err
	}
	dir.version, _, err = dir.MaybeGenerateVersionString(logger)
	if err != nil {
		logger.Warningf("trying to generate version string: %v", err)
	}
	return writeArchive(w, dir.Path, dir.revision, dir.version, dir.Meta().Hooks(), ignoreRules)
}
func ( dir * CharmDir ) ArchiveTo ( w io . Writer ) error { ignoreRules , err := dir . buildIgnoreRules ( ) if err != nil { return err } dir . version , _ , err = dir . MaybeGenerateVersionString ( logger ) if err != nil { logger . Warningf ( " " , err ) } return writeArchive ( w , dir . Path , dir . revision , dir . version , dir . Meta ( ) . Hooks ( ) , ignoreRules ) }
ArchiveTo creates a charm file from the charm expanded in dir.
ArchiveTo creates a charm file from the charm expanded in dir .
// We update the version to make sure we don't lag behind // We don't want to stop, even if the version cannot be generated