Skip to content

Commit

Permalink
fix test and small language fix
Browse files Browse the repository at this point in the history
  • Loading branch information
principis committed Apr 13, 2019
1 parent 7086db3 commit 7c96aec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
8 changes: 4 additions & 4 deletions scripts/test.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /bin/bash

set -x
cd tldr-sharp/bin/Release

chmod +x tldr_sharp.exe
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
3 changes: 1 addition & 2 deletions tldr-sharp/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,10 @@ private static int GetPage(string page, string language = null, string platform
language = language ?? GetLanguage();
var preferredLanguages = new List<string> {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;
Expand Down

0 comments on commit 7c96aec

Please sign in to comment.