mirror of https://git.sr.ht/~rjarry/aerc
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
613 B
Go
35 lines
613 B
Go
package patch
|
|
|
|
import (
|
|
"git.sr.ht/~rjarry/aerc/commands"
|
|
"git.sr.ht/~rjarry/aerc/lib/pama"
|
|
)
|
|
|
|
type Term struct {
|
|
Cmd []string `opt:"..." required:"false"`
|
|
}
|
|
|
|
func init() {
|
|
register(Term{})
|
|
}
|
|
|
|
func (Term) Description() string {
|
|
return "Open a shell or run a command in the current project's directory."
|
|
}
|
|
|
|
func (Term) Context() commands.CommandContext {
|
|
return commands.GLOBAL
|
|
}
|
|
|
|
func (Term) Aliases() []string {
|
|
return []string{"term"}
|
|
}
|
|
|
|
func (t Term) Execute(_ []string) error {
|
|
p, err := pama.New().CurrentProject()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
return commands.TermCoreDirectory(t.Cmd, p.Root)
|
|
}
|