Skip to content

Commit

Permalink
Release 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
RudraSwat committed Jun 21, 2020
1 parent 383e300 commit 152b7c3
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 6 deletions.
32 changes: 27 additions & 5 deletions components/UnityBugReporter.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// System libraries
using System;
using System.Diagnostics;
using System.Threading;
using System.IO;

namespace devunity.components
Expand Down Expand Up @@ -32,17 +33,38 @@ public static void BugReporter()
file.WriteLine("BUG DETAILS -->");
file.WriteLine(bugDetails);
file.WriteLine();
Console.WriteLine("Please enter the affected Unity7 program (if you do not know, please type 'do not know'):");
Console.WriteLine("Please enter the affected Unity7 program (if you do not know, please type 'dunno'):");
string affectedProgram = Console.ReadLine();
file.WriteLine("AFFECTED PROGRAM -->");
if (!affectedProgram.Contains("unity")) {
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("ERROR: NOT A UNITY BUG");
Environment.Exit(-1);
}
file.WriteLine("AFFECTED PACKAGE -->");
file.WriteLine(affectedProgram);
Console.WriteLine("Please send the file (or its contents): " + fileToWrite + " when reporting the bug.");
Console.WriteLine("Do you want to report the bug now? (^C to cancel - ENTER to proceed) ");
Console.ReadLine();
Console.WriteLine("Redirecting to the Bug Reporter in 5 seconds. Please attach this file: " + fileToWrite + " when reporting the bug. If it gives the error 'Lost something?', make sure you entered the correct package name.");
Thread.Sleep(5000);
openLaunchpad(affectedProgram);
}
} catch {
}
catch (Exception e) {
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("ERROR: FAILED");
Console.WriteLine("ERROR: FAILED: " + e.Message);
Environment.Exit(-1);
}
}

public static void openLaunchpad(string pName) {
if ((pName == "dunno") || (pName == "'dunno'"))
{
Process.Start("xdg-open", "https://bugs.launchpad.net/ubuntu/+filebug?no-redirect");
}
else if (pName.Contains("unity"))
{
Process.Start("xdg-open", "https://bugs.launchpad.net/ubuntu/+source/" + pName + "/+filebug?no-redirect");
}
}
}
}
2 changes: 1 addition & 1 deletion components/UnityProcessStatus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public static void ProcessStatus()
{
Console.Write("Process to get status of: ");
string pName = Console.ReadLine();
Console.WriteLine();
if (pName.Contains("unity"))
{
try
Expand All @@ -19,7 +20,6 @@ public static void ProcessStatus()
foreach (Process p in pArray)
{
Console.WriteLine($"{pName}:");
Console.WriteLine();
Console.WriteLine($" Process ID : {p.Id}");
Console.WriteLine($" Physical memory usage : {p.WorkingSet64}");
Console.WriteLine($" User processor time : {p.UserProcessorTime}");
Expand Down

0 comments on commit 152b7c3

Please sign in to comment.