Skip to content

Commit

Permalink
Added ThrowException function for scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
microdee committed Aug 17, 2017
1 parent 4d54109 commit 37efa86
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/vpm/scriptglobals.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,20 @@ public VpmGlobals(VPack currentPack)
Pack = currentPack;
}

public void ThrowException(Exception e)
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("Script thrown an Exception, contact the pack developer:");
Console.ForegroundColor = ConsoleColor.White;
Console.WriteLine(e.Message);
Console.ForegroundColor = ConsoleColor.Gray;
Console.WriteLine(e.StackTrace);
Console.WriteLine("");
Console.WriteLine("Pack is not installed most probably");
Console.WriteLine("Press any key to continue...");
Console.ReadKey();
}

public void CopyDir(string srcdir, string dstdir, string[] ignore = null, string[] match = null)
{
Console.ForegroundColor = ConsoleColor.White;
Expand Down

0 comments on commit 37efa86

Please sign in to comment.