2023-06-20 21:44:50 +00:00
|
|
|
package stackops
|
|
|
|
|
|
|
|
import (
|
|
|
|
basetypes "code.apps.glenux.net/glenux/kiwimix/pkg/basetypes"
|
|
|
|
)
|
|
|
|
|
|
|
|
type SaveOperation struct {
|
|
|
|
filePath string
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewSaveOperation(filePath string) *SaveOperation {
|
|
|
|
saveop := new(SaveOperation)
|
|
|
|
return saveop
|
|
|
|
}
|
|
|
|
|
2023-08-06 10:52:27 +00:00
|
|
|
func (op *SaveOperation) Execute(stack *basetypes.Stack) error {
|
2023-06-20 21:44:50 +00:00
|
|
|
cal, err := basetypes.ParseCalendarFile(op.filePath)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
stack.Push(cal)
|
|
|
|
return nil
|
|
|
|
}
|