diff --git a/scripts/test.sh b/scripts/test.sh index 5776a6b..f754020 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -1,5 +1,5 @@ #! /bin/bash - + set -x cd tldr-sharp/bin/Release chmod +x tldr_sharp.exe @@ -78,13 +78,13 @@ if [ $? == 0 ]; then fi # test os -mono tldr_sharp.exe tldr --os=linux >/dev/null +mono tldr_sharp.exe tldr --platform=linux >/dev/null if [ $? != 0 ]; then exit 1 fi # Test os non-existing page -mono tldr_sharp.exe dir --os=linux >/dev/null +mono tldr_sharp.exe giberishdsfsd --platform=linux >/dev/null if [ $? == 0 ]; then exit 1 fi @@ -102,7 +102,7 @@ if [ $? != 0 ]; then fi # Test version -mono tldr_sharp.exe tldr -V >/dev/null +mono tldr_sharp.exe tldr -v >/dev/null if [ $? != 0 ]; then exit 1 fi diff --git a/tldr-sharp/Program.cs b/tldr-sharp/Program.cs index 1a13fdc..c9fd862 100644 --- a/tldr-sharp/Program.cs +++ b/tldr-sharp/Program.cs @@ -223,11 +223,10 @@ private static int GetPage(string page, string language = null, string platform language = language ?? GetLanguage(); var preferredLanguages = new List {language, Language}; - var langs = Environment.GetEnvironmentVariable("LANGUAGE")?.Split(':'); + var langs = Environment.GetEnvironmentVariable("LANGUAGE")?.Split(':').Where(x => !x.Equals(string.Empty)).ToList(); if (langs != null) { preferredLanguages.AddRange(langs); - } platform = platform ?? GetPlatform(); string altPlatform = null;