Skip to content

Commit 409a36a

Browse files
authored
fix(gatsby-recipes): Only remove the ".mdx" ending if running local recipe (#27718)
This fixes showing the correct install command when running recipes from the recipes list shown when running `gatsby recipes`
1 parent 919e81f commit 409a36a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/gatsby-recipes/src/cli/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,11 @@ export default async ({
435435
</Text>
436436
<RecipesList
437437
setRecipe={async recipeItem => {
438-
setRecipe(recipeItem.value.slice(0, -4))
438+
if (recipeItem.value.endsWith(`.mdx`)) {
439+
setRecipe(recipeItem.value.slice(0, -4))
440+
} else {
441+
setRecipe(recipeItem.value)
442+
}
439443
trackCli(`RECIPE_RUN`, { name: recipeItem.value })
440444
showRecipesList = false
441445
try {

0 commit comments

Comments
 (0)