Skip to content
This repository has been archived by the owner on Mar 1, 2020. It is now read-only.

Commit

Permalink
Added support for newer versions of PIA where the ruby files are put …
Browse files Browse the repository at this point in the history
…under src\bin instead of just src.
  • Loading branch information
erik434 committed Jan 28, 2018
1 parent b998e53 commit 20c058f
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions PIA_manager/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,22 @@ private static void FindPiaFiles()
Console.WriteLine($"Ruby files directory: {rubyFilesDir}");

rubyExecutable = Path.Combine(rubyFilesDir, "bin", "rubyw.exe");
rubySourceFile = Path.Combine(rubyFilesDir, "src", "pia_manager.rb");

if (!File.Exists(rubyExecutable)) throw new FileNotFoundException("Could not find ruby executable", rubyExecutable);
if (!File.Exists(rubySourceFile)) throw new FileNotFoundException("Could not find pia_manager ruby file", rubySourceFile);

var rubySourceFileOld = Path.Combine(rubyFilesDir, "src", "pia_manager.rb");
var rubySourceFileNew = Path.Combine(rubyFilesDir, "src", "bin", "pia_manager.rb");
if (File.Exists(rubySourceFileOld))
{
rubySourceFile = rubySourceFileOld;
}
else if (File.Exists(rubySourceFileNew))
{
rubySourceFile = rubySourceFileNew;
}
else
{
throw new FileNotFoundException("Could not find pia_manager ruby file", rubySourceFile);
}
}

static bool DirContainsPiaFiles(string searchDir)
Expand Down

0 comments on commit 20c058f

Please sign in to comment.