Skip to content

Commit

Permalink
Merge pull request #89 from nervosnetwork/release/v0.3.2
Browse files Browse the repository at this point in the history
Release/v0.3.2
  • Loading branch information
ashchan authored Jun 1, 2021
2 parents 6e0b709 + d95fe14 commit 225b7c9
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 15 deletions.
6 changes: 1 addition & 5 deletions src/Tippy.Ctrl/Process/BinariesInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ internal void Refresh()
void RefreshDebuggerDeps()
{
HasDebuggerDeps = true;
// BUGBUG: .Net won't find commands on M1 Mac which has homebrew location at `/opt/homebrew/bin`.
foreach (var dep in new List<string>() { "gdb", "ttyd" })
{
try
Expand All @@ -61,10 +60,7 @@ void RefreshDebuggerDeps()
process.StartInfo.RedirectStandardOutput = true;
process.OutputDataReceived += (sender, e) =>
{
if (!String.IsNullOrEmpty(e.Data))
{
Info += e.Data + "\n";
}
// Do not show gdb/ttyd
};
process.Start();
process.BeginOutputReadLine();
Expand Down
14 changes: 13 additions & 1 deletion src/Tippy.Ctrl/Process/Debugger/ProcessManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ public class ProcessManager
public static void Start(Project project, string scriptGroupType, string scriptHash, string txFilePath, string debugFilePath, string ioType, int ioIndex, string? binaryForDebugger)
{
Stop();
// TODO: Maybe not need project.
ProcessInfo processInfo = ProcessInfo.FromProject(project);
GdbProcessInstance = new GdbProcess(processInfo, debugFilePath);
DebuggerProcessInstance = new DebuggerProcess(processInfo, scriptGroupType, scriptHash, txFilePath, ioType, ioIndex, binaryForDebugger);
Expand All @@ -23,5 +22,18 @@ public static void Stop()
GdbProcessInstance?.Stop();
DebuggerProcessInstance?.Stop();
}

public static void SetEnv()
{
// BUGBUG: .Net won't find commands on M1 Mac which has homebrew location at `/opt/homebrew/bin`,
// or on Linux which at `~/.linuxbrew/bin`.
var path = System.Environment.GetEnvironmentVariable("PATH") ?? "";
if (!string.IsNullOrEmpty(path))
{
path += ":";
}
path += "/opt/homebrew/bin:/home/linuxbrew/.linuxbrew/bin:~/.linuxbrew/bin";
System.Environment.SetEnvironmentVariable("PATH", path);
}
}
}
1 change: 1 addition & 0 deletions src/Tippy.Ctrl/ProcessManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public static string GetLogFolder(Project project)

public static void FetchInfo()
{
Process.Debugger.ProcessManager.SetEnv();
BinariesInfo binariesInfo = new();
binariesInfo.Refresh();
Info = binariesInfo.Info;
Expand Down
2 changes: 1 addition & 1 deletion src/Tippy.Util/UrlOpener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static void Open(string url)
}
catch
{
Console.WriteLine($"Couldn't open URL $(url). Try opening it from your browser.");
Console.WriteLine($"Couldn't open URL {url}. Try opening it from your browser.");
}
}
}
Expand Down
16 changes: 11 additions & 5 deletions src/Tippy/Pages/Transactions/Details.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,11 @@
@if (Model.IsDebuggerSupported)
{
<div class="column is-10">
@if (Model.DebuggerDepsInstalled)
@if (Model.DebuggerDepsInstalled)
{
<a asp-page="/Debugger/Details" asp-route-txHash="@Model.Transaction.Hash" asp-route-ioIndex="@index" asp-route-ioType="input" asp-route-scriptType="0" class="button">Debug this script</a>
}
else
else
{
<a class="button" href="#" disabled>Debug this script</a>
}
Expand Down Expand Up @@ -178,7 +178,7 @@
{
<a class="button" href="#" disabled>Debug this script</a>
}
<Partial name="_DebuggerInfo" />
<Partial name="_DebuggerInfo" />
</div>
}
}
Expand Down Expand Up @@ -300,11 +300,17 @@
@if (Model.IsDebuggerSupported)
{
<div class="column is-5">
<a asp-page="/Debugger/Details" asp-route-txHash="@Model.Transaction.Hash" asp-route-ioIndex="@index" asp-route-ioType="output" asp-route-scriptType="1" class="button">Debug this script</a>
@if (Model.DebuggerDepsInstalled)
{
<a asp-page="/Debugger/Details" asp-route-txHash="@Model.Transaction.Hash" asp-route-ioIndex="@index" asp-route-ioType="output" asp-route-scriptType="1" class="button">Debug this script</a>
}
else
{
<a class="button" href="#" disabled>Debug this script</a>
}
<Partial name="_DebuggerInfo" />
</div>
}

}
<div class="column is-12">
@if (typeScript != null)
Expand Down
2 changes: 1 addition & 1 deletion src/Tippy/Tippy.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<IsPackable>false</IsPackable>
<DebugType>embedded</DebugType>
<UserSecretsId>6e0dc08b-01f2-47f6-8249-66ed1b18f469</UserSecretsId>
<Version>0.3.1</Version>
<Version>0.3.2</Version>
<PackageProjectUrl>https://github.com/nervosnetwork/tippy</PackageProjectUrl>
<RepositoryUrl>https://github.com/nervosnetwork/tippy</RepositoryUrl>
<Copyright>Copyright (c) Nervos Foundation</Copyright>
Expand Down
4 changes: 2 additions & 2 deletions tools/osx/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
<key>CFBundleIconFile</key>
<string>Tippy.icns</string>
<key>CFBundleVersion</key>
<string>0.3.1</string>
<string>0.3.2</string>
<key>CFBundleShortVersionString</key>
<string>0.3.1</string>
<string>0.3.2</string>
<key>CFBundleExecutable</key>
<string>main</string>
<key>CFBundleInfoDictionaryVersion</key>
Expand Down

0 comments on commit 225b7c9

Please sign in to comment.