Skip to content

Commit

Permalink
fix: remove all tags from URL
Browse files Browse the repository at this point in the history
  • Loading branch information
majori committed Mar 13, 2024
1 parent 2200f03 commit e94a331
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/cli/execute.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"os"
"path/filepath"
"regexp"
"strings"

"github.com/futurice/jalapeno/internal/cli/option"
Expand Down Expand Up @@ -202,7 +203,8 @@ func runExecute(cmd *cobra.Command, opts executeOptions) error {

// Automatically add recipe origin if the recipe was remote
if wasRemoteRecipe {
sauce.CheckFrom = strings.TrimSuffix(opts.RecipeURL, fmt.Sprintf(":%s", re.Metadata.Version))
re := regexp.MustCompile(`(.+)(:[^\/\/].+)$`)
sauce.CheckFrom = re.ReplaceAllString(opts.RecipeURL, "$1")
}

// Check for conflicts
Expand Down
1 change: 1 addition & 0 deletions test/features/execute-recipes.feature
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Feature: Execute recipes
Then execution of the recipe has succeeded
And no errors were printed
And the project directory should contain file "README.md"
And the sauce in index 0 which should have property "CheckFrom" with value "^oci://.+/foo$"

Scenario: Execute multiple recipes
Given a project directory
Expand Down

0 comments on commit e94a331

Please sign in to comment.