Command processing
This commit is contained in:
@@ -146,6 +146,10 @@ func (b PlaceBuilder) Build() error {
|
||||
return err
|
||||
}
|
||||
|
||||
if b.Options.Writer != nil {
|
||||
return xml.Serialize(b.Options.Writer, nil, b.root)
|
||||
}
|
||||
|
||||
file, err := os.OpenFile(b.Options.Output, os.O_CREATE|os.O_WRONLY, 0644)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to open output file")
|
||||
|
||||
@@ -15,7 +15,7 @@ type DumpSettings struct {
|
||||
type BuildSettings struct {
|
||||
Source string
|
||||
Output string
|
||||
Writer *io.Writer
|
||||
Writer io.Writer
|
||||
}
|
||||
|
||||
type Manifest struct {
|
||||
@@ -28,13 +28,13 @@ type Script struct {
|
||||
Class string
|
||||
}
|
||||
|
||||
func NewPlaceDump(options *DumpSettings) error {
|
||||
func DumpPlace(options *DumpSettings) error {
|
||||
return PlaceDumper{
|
||||
Options: options,
|
||||
}.Dump()
|
||||
}
|
||||
|
||||
func NewPlaceBuilder(options *BuildSettings) error {
|
||||
func BuildPlace(options *BuildSettings) error {
|
||||
return PlaceBuilder{
|
||||
Options: options,
|
||||
}.Build()
|
||||
|
||||
Reference in New Issue
Block a user