Skip to content

Commit

Permalink
Fix dependency download errors from github.com.
Browse files Browse the repository at this point in the history
  • Loading branch information
MustaphaTR committed Sep 11, 2018
1 parent a364569 commit d3de273
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions thirdparty/fetch-thirdparty-deps.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,23 @@ if (!(Test-Path "FuzzyLogicLibrary.dll"))
rmdir FuzzyLogicLibrary -Recurse
}

if (!(Test-Path "GeoLite2-Country.mmdb.gz") -Or (((get-date) - (get-item "GeoLite2-Country.mmdb.gz").LastWriteTime) -gt (new-timespan -days 30)))
{
echo "Updating GeoIP country database from MaxMind."
$target = Join-Path $pwd.ToString() "GeoLite2-Country.mmdb.gz"
(New-Object System.Net.WebClient).DownloadFile("http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz", $target)
}

if (!(Test-Path "SmarIrc4net.dll"))
{
echo "Fetching SmartIrc4net from NuGet."
./nuget.exe install SmartIrc4net -Version 0.4.5.1 -ExcludeVersion -Verbosity quiet
cp SmartIrc4net/lib/net40/SmarIrc4net.* .
rmdir SmartIrc4net -Recurse
}

[Net.ServicePointManager]::SecurityProtocol = 'Tls12'

if (!(Test-Path "SDL2-CS.dll"))
{
echo "Fetching SDL2-CS from GitHub."
Expand All @@ -143,19 +160,4 @@ if (!(Test-Path "Eluant.dll"))
(New-Object System.Net.WebClient).DownloadFile("https://github.com/OpenRA/Eluant/releases/download/20160124/Eluant.dll", $target)
}

if (!(Test-Path "GeoLite2-Country.mmdb.gz") -Or (((get-date) - (get-item "GeoLite2-Country.mmdb.gz").LastWriteTime) -gt (new-timespan -days 30)))
{
echo "Updating GeoIP country database from MaxMind."
$target = Join-Path $pwd.ToString() "GeoLite2-Country.mmdb.gz"
(New-Object System.Net.WebClient).DownloadFile("http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz", $target)
}

if (!(Test-Path "SmarIrc4net.dll"))
{
echo "Fetching SmartIrc4net from NuGet."
./nuget.exe install SmartIrc4net -Version 0.4.5.1 -ExcludeVersion -Verbosity quiet
cp SmartIrc4net/lib/net40/SmarIrc4net.* .
rmdir SmartIrc4net -Recurse
}

cd ..

0 comments on commit d3de273

Please sign in to comment.