Skip to content

Commit

Permalink
Added wildcards to ignore_files
Browse files Browse the repository at this point in the history
  • Loading branch information
daredloco committed Oct 24, 2020
1 parent 60d0731 commit 158c204
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 13 deletions.
41 changes: 30 additions & 11 deletions GitInstaller/GitInstaller/Installer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,19 +157,38 @@ async void DownloadAssets()
client.Headers.Add("user-agent", "GitInstaller");
try
{
if (!Array.Exists(Settings.Ignored_Files, x => x == asset.Filename))
{
string installfname = Path.Combine(_installdir, asset.Filename);
await client.DownloadFileTaskAsync(new Uri(asset.DownloadUrl), installfname);
downloadedfiles.Add(installfname);
assetcount++;
_window.WriteLog($"Asset downloaded... ({assetcount}/{maxcount})");
}
else

foreach(string ignoredfile in Settings.Ignored_Files)
{
_window.WriteLog($"Asset \"{asset.Filename}\" will be ignored...");
assetcount++;
if(!Utils.HasWildcard(asset.Filename, ignoredfile))
{
string installfname = Path.Combine(_installdir, asset.Filename);
await client.DownloadFileTaskAsync(new Uri(asset.DownloadUrl), installfname);
downloadedfiles.Add(installfname);
assetcount++;
_window.WriteLog($"Asset downloaded... ({assetcount}/{maxcount})");
}
else
{
_window.WriteLog($"Asset \"{asset.Filename}\" will be ignored...");
assetcount++;
}
}

//Old
//if (!Array.Exists(Settings.Ignored_Files, x => x == asset.Filename))
//{
// string installfname = Path.Combine(_installdir, asset.Filename);
// await client.DownloadFileTaskAsync(new Uri(asset.DownloadUrl), installfname);
// downloadedfiles.Add(installfname);
// assetcount++;
// _window.WriteLog($"Asset downloaded... ({assetcount}/{maxcount})");
//}
//else
//{
// _window.WriteLog($"Asset \"{asset.Filename}\" will be ignored...");
// assetcount++;
//}
}
catch (Exception ex)
{
Expand Down
4 changes: 2 additions & 2 deletions GitInstaller/GitInstaller/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// indem Sie "*" wie unten gezeigt eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.5.0")]
[assembly: AssemblyFileVersion("1.2.5.0")]
[assembly: AssemblyVersion("1.3.0.0")]
[assembly: AssemblyFileVersion("1.3.0.0")]

0 comments on commit 158c204

Please sign in to comment.