summaryrefslogtreecommitdiff
path: root/runner/shell/hydrated.go
blob: 440d9cd0499db6251bcfbd998ee54c3c096f80c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package shell

import (
	"github.com/ewy1/pik/describe"
	"github.com/ewy1/pik/model"
	"github.com/ewy1/pik/runner"
	"github.com/ewy1/pik/spool"
)

type Hydrated struct {
	runner.BaseHydration[*Target]
}

func (h *Hydrated) Icon() string {
	return "\uF489"
}

func (h *Hydrated) Description(src *model.HydratedSource) string {
	desc, err := describe.Describe(h.Target(), h.Target().File(src.Source))
	if err != nil {
		_, _ = spool.Warn("%v\n", err)
		return ""
	}
	return desc
}