diff --git a/internal/resource/exec.go b/internal/resource/exec.go index 6c9adeb..be6aa0a 100644 --- a/internal/resource/exec.go +++ b/internal/resource/exec.go @@ -10,6 +10,7 @@ import ( "net/url" _ "os" _ "os/exec" + "path/filepath" _ "strings" ) @@ -41,7 +42,13 @@ func (x *Exec) URI() string { } func (x *Exec) SetURI(uri string) error { - return nil + resourceUri, e := url.Parse(uri) + if resourceUri.Scheme == "exec" { + x.Id = filepath.Join(resourceUri.Hostname(), resourceUri.RequestURI()) + } else { + e = fmt.Errorf("%w: %s is not an exec resource ", ErrInvalidResourceURI, uri) + } + return e } func (x *Exec) ResolveId(ctx context.Context) string {