mirror of
https://github.com/asciinema/asciinema.git
synced 2025-12-16 19:58:03 +01:00
29 lines
387 B
Go
29 lines
387 B
Go
package commands
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/asciinema/asciinema-cli/api"
|
|
)
|
|
|
|
type UploadCommand struct {
|
|
API api.API
|
|
}
|
|
|
|
func NewUploadCommand(api api.API) *UploadCommand {
|
|
return &UploadCommand{
|
|
API: api,
|
|
}
|
|
}
|
|
|
|
func (c *UploadCommand) Execute(filename string) error {
|
|
url, err := c.API.UploadAsciicast(filename)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
fmt.Println(url)
|
|
|
|
return nil
|
|
}
|