From afc711ec88d03567eaaa19995735dca041fa9a6a Mon Sep 17 00:00:00 2001 From: hemarina <104857065+hemarina@users.noreply.github.com> Date: Mon, 22 Jan 2024 14:10:22 -0800 Subject: [PATCH] update azd init command to case non sensitive (#294) * case non sensitive * same for card panel --- website/src/components/gallery/ShowcaseCard/index.tsx | 6 +++--- .../src/components/gallery/ShowcaseCardPanel/index.tsx | 8 +++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/website/src/components/gallery/ShowcaseCard/index.tsx b/website/src/components/gallery/ShowcaseCard/index.tsx index 6aba6572..4cdde4e7 100644 --- a/website/src/components/gallery/ShowcaseCard/index.tsx +++ b/website/src/components/gallery/ShowcaseCard/index.tsx @@ -67,9 +67,9 @@ function ShowcaseCard({ user }: { user: User }): JSX.Element { const star = useBaseUrl("/img/Sparkle.svg"); const fire = useBaseUrl("/img/Fire.svg"); let azdInitCommand = - "azd init -t " + source.replace("https://github.com/", ""); - if (azdInitCommand.includes("Azure-Samples/")) { - azdInitCommand = azdInitCommand.replace("Azure-Samples/", ""); + "azd init -t " + source.replace("https://github.com/", "").toLowerCase(); + if (azdInitCommand.includes("azure-samples/")) { + azdInitCommand = azdInitCommand.replace("azure-samples/", ""); } let headerLogo = useBaseUrl("/img/Community.svg"); let headerText = "Community Authored"; diff --git a/website/src/components/gallery/ShowcaseCardPanel/index.tsx b/website/src/components/gallery/ShowcaseCardPanel/index.tsx index cdd2b59e..6393151b 100644 --- a/website/src/components/gallery/ShowcaseCardPanel/index.tsx +++ b/website/src/components/gallery/ShowcaseCardPanel/index.tsx @@ -98,9 +98,11 @@ export default function ShowcaseCardPanel({ user }: { user: User }) { { toggle: toggleIsPopupVisibleAzureCalculator }, ] = useBoolean(true); - let templateURL = user.source.replace("https://github.com/", ""); - if (templateURL.includes("Azure-Samples/")) { - templateURL = templateURL.replace("Azure-Samples/", ""); + let templateURL = user.source + .replace("https://github.com/", "") + .toLowerCase(); + if (templateURL.includes("azure-samples/")) { + templateURL = templateURL.replace("azure-samples/", ""); } const azdInitCommand = "azd init -t " + templateURL; let chevronSVG = useBaseUrl("/img/leftChevron.svg");