Skip to content

Commit

Permalink
fix(gatsby-recipes): Only remove the ".mdx" ending if running local r…
Browse files Browse the repository at this point in the history
…ecipe (gatsbyjs#27718)

This fixes showing the correct install command when running recipes from the recipes list shown when running `gatsby recipes`
  • Loading branch information
KyleAMathews authored Nov 2, 2020
1 parent 919e81f commit 409a36a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/gatsby-recipes/src/cli/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,11 @@ export default async ({
</Text>
<RecipesList
setRecipe={async recipeItem => {
setRecipe(recipeItem.value.slice(0, -4))
if (recipeItem.value.endsWith(`.mdx`)) {
setRecipe(recipeItem.value.slice(0, -4))
} else {
setRecipe(recipeItem.value)
}
trackCli(`RECIPE_RUN`, { name: recipeItem.value })
showRecipesList = false
try {
Expand Down

0 comments on commit 409a36a

Please sign in to comment.