From 9bcd0e9cdb03abab12b7da1805244fbb143feb0a Mon Sep 17 00:00:00 2001 From: Arsen Yeremin Date: Wed, 27 Nov 2024 17:50:45 -0800 Subject: [PATCH] onchain job creator compatibility with full path to repo --- pkg/jobcreator/onchain_jobcreator.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pkg/jobcreator/onchain_jobcreator.go b/pkg/jobcreator/onchain_jobcreator.go index e4c841d3..e760bdd1 100644 --- a/pkg/jobcreator/onchain_jobcreator.go +++ b/pkg/jobcreator/onchain_jobcreator.go @@ -112,11 +112,19 @@ func (jobCreator *OnChainJobCreator) Start(ctx context.Context, cm *system.Clean options := jobCreator.options.Offer options.Module.Name = ev.Module + if strings.Contains(options.Module.Name, "github.com") { + parts := strings.Split(options.Module.Name, ":") + options.Module.Name = "" + options.Module.Repo = "https://" + parts[0] + options.Module.Hash = parts[1] + options.Module.Path = "/lilypad_module.json.tmpl" + } + inputs := map[string]string{} for _, input := range ev.Inputs { parts := strings.Split(input, "=") - if len(parts) == 2 { - inputs[parts[0]] = parts[1] + if len(parts) > 1 { + inputs[parts[0]] = strings.Join(parts[1:], "=") } } options.Inputs = inputs