diff --git a/scripts/install_from_release.sh b/scripts/install_from_release.sh index ce837524..c6163658 100644 --- a/scripts/install_from_release.sh +++ b/scripts/install_from_release.sh @@ -10,15 +10,46 @@ if [ "$RELEASE" == "" ]; then RELEASE="latest" fi +# Set a default scenarios file +SCENARIOS="https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/scenarios.zip" + # Map the language parameter to the corresponding scenarios file # If no parameter, download the scenarios from IE -if [ "$LANG" = "" ]; then - SCENARIOS="https://github.com/Azure/InnovationEngine/releases/download/$RELEASE/scenarios.zip" -# Otherwise, download the scenarios from Microsoft Docs in the appropriate langauge -elif [ "$LANG" = "en-us" ]; then - SCENARIOS='https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/scenarios.zip' -else - SCENARIOS="https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/$LANG-scenarios.zip" +MAIN_LANG_PREFIX="$(echo "$LANG" | head -c2 | tr '[:upper:]' '[:lower:]')" +LANG_ARRAY=("de" "es" "fr" "it" "nl" "pt" "zh" "cs" "hu" "id" "ja" "ko" "pl" "pt" "ru" "sv" "tr") + +if [[ "${LANG_ARRAY[*]}" =~ "$MAIN_LANG_PREFIX" ]]; then + SCENARIOS="https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/$MAIN_LANG_PREFIX-$MAIN_LANG_PREFIX-scenarios.zip" + if [ "$MAIN_LANG_PREFIX" = "pt" ]; then + if [ "$LANG" = "pt-pt" ]; then + SCENARIOS="https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/pt-pt-scenarios.zip" + elif [ "$LANG" = "pt-br" ]; then + SCENARIOS="https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/pt-br-scenarios.zip" + else + SCENARIOS="https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/pt-pt-scenarios.zip" + fi + fi + if [ "$MAIN_LANG_PREFIX" = "zh" ]; then + if [ "$LANG" = "zh-cn" ]; then + SCENARIOS="https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/zh-cn-scenarios.zip" + elif [ "$LANG" = "zh-tw" ]; then + SCENARIOS="https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/zh-tw-scenarios.zip" + else + SCENARIOS="https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/zh-cn-scenarios.zip" + fi + fi + if [ "$MAIN_LANG_PREFIX" = "cs" ]; then + SCENARIOS="https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/$MAIN_LANG_PREFIX-cz-scenarios.zip" + fi + if [ "$MAIN_LANG_PREFIX" = "ja" ]; then + SCENARIOS="https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/$MAIN_LANG_PREFIX-jp-scenarios.zip" + fi + if [ "$MAIN_LANG_PREFIX" = "ko" ]; then + SCENARIOS="https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/$MAIN_LANG_PREFIX-kr-scenarios.zip" + fi + if [ "$MAIN_LANG_PREFIX" = "sv" ]; then + SCENARIOS="https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/$MAIN_LANG_PREFIX-se-scenarios.zip" + fi fi # Download the binary