From ef28ad37573efa0f98acaa982fee25c49d2a94a6 Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 31 May 2021 11:55:46 +0900 Subject: [PATCH 1/6] Use propery string interpolation for UrlOpener error message --- src/Tippy.Util/UrlOpener.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Tippy.Util/UrlOpener.cs b/src/Tippy.Util/UrlOpener.cs index 1823128..6de7238 100644 --- a/src/Tippy.Util/UrlOpener.cs +++ b/src/Tippy.Util/UrlOpener.cs @@ -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."); } } } From 8883298f926a2f41d79211ab8180214b2913607c Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 31 May 2021 13:43:20 +0900 Subject: [PATCH 2/6] Disable debug output script button when gdb is not detected Fix #88 --- src/Tippy/Pages/Transactions/Details.cshtml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/Tippy/Pages/Transactions/Details.cshtml b/src/Tippy/Pages/Transactions/Details.cshtml index 704c16e..b4fc990 100644 --- a/src/Tippy/Pages/Transactions/Details.cshtml +++ b/src/Tippy/Pages/Transactions/Details.cshtml @@ -140,11 +140,11 @@ @if (Model.IsDebuggerSupported) {
- @if (Model.DebuggerDepsInstalled) + @if (Model.DebuggerDepsInstalled) { Debug this script } - else + else { Debug this script } @@ -178,7 +178,7 @@ { Debug this script } - +
} } @@ -300,11 +300,17 @@ @if (Model.IsDebuggerSupported) {
- Debug this script + @if (Model.DebuggerDepsInstalled) + { + Debug this script + } + else + { + Debug this script + }
} - }
@if (typeScript != null) From 6c416935fd51a06d582ef89cce8c60991168e86c Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 31 May 2021 18:17:10 +0900 Subject: [PATCH 3/6] Add homebrew path to PATH env --- src/Tippy.Ctrl/Process/BinariesInfo.cs | 1 - src/Tippy.Ctrl/Process/Debugger/ProcessManager.cs | 13 +++++++++++++ src/Tippy.Ctrl/ProcessManager.cs | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/Tippy.Ctrl/Process/BinariesInfo.cs b/src/Tippy.Ctrl/Process/BinariesInfo.cs index 4189a4f..9746d0d 100644 --- a/src/Tippy.Ctrl/Process/BinariesInfo.cs +++ b/src/Tippy.Ctrl/Process/BinariesInfo.cs @@ -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() { "gdb", "ttyd" }) { try diff --git a/src/Tippy.Ctrl/Process/Debugger/ProcessManager.cs b/src/Tippy.Ctrl/Process/Debugger/ProcessManager.cs index 9b53f76..4a70f4c 100644 --- a/src/Tippy.Ctrl/Process/Debugger/ProcessManager.cs +++ b/src/Tippy.Ctrl/Process/Debugger/ProcessManager.cs @@ -23,5 +23,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); + } } } diff --git a/src/Tippy.Ctrl/ProcessManager.cs b/src/Tippy.Ctrl/ProcessManager.cs index 46159ff..ed409e6 100644 --- a/src/Tippy.Ctrl/ProcessManager.cs +++ b/src/Tippy.Ctrl/ProcessManager.cs @@ -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; From 2c169a988c16660333068ed1c13061af41a26884 Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 31 May 2021 18:22:43 +0900 Subject: [PATCH 4/6] Do not show gdb/ttyd info in binary info section --- src/Tippy.Ctrl/Process/BinariesInfo.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Tippy.Ctrl/Process/BinariesInfo.cs b/src/Tippy.Ctrl/Process/BinariesInfo.cs index 9746d0d..9425055 100644 --- a/src/Tippy.Ctrl/Process/BinariesInfo.cs +++ b/src/Tippy.Ctrl/Process/BinariesInfo.cs @@ -60,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(); From 7261abf9ea0cf187a5120a83b91e4ebe85f356d7 Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 31 May 2021 18:23:31 +0900 Subject: [PATCH 5/6] Remove comment making no sense --- src/Tippy.Ctrl/Process/Debugger/ProcessManager.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Tippy.Ctrl/Process/Debugger/ProcessManager.cs b/src/Tippy.Ctrl/Process/Debugger/ProcessManager.cs index 4a70f4c..ff8cb1c 100644 --- a/src/Tippy.Ctrl/Process/Debugger/ProcessManager.cs +++ b/src/Tippy.Ctrl/Process/Debugger/ProcessManager.cs @@ -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); From d95fe1457d14d4af49d6c7570cbadc9be007b9b5 Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 1 Jun 2021 11:06:02 +0900 Subject: [PATCH 6/6] Bump version to v0.3.2 --- src/Tippy/Tippy.csproj | 2 +- tools/osx/Info.plist | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Tippy/Tippy.csproj b/src/Tippy/Tippy.csproj index d8109be..69cf308 100644 --- a/src/Tippy/Tippy.csproj +++ b/src/Tippy/Tippy.csproj @@ -8,7 +8,7 @@ false embedded 6e0dc08b-01f2-47f6-8249-66ed1b18f469 - 0.3.1 + 0.3.2 https://github.com/nervosnetwork/tippy https://github.com/nervosnetwork/tippy Copyright (c) Nervos Foundation diff --git a/tools/osx/Info.plist b/tools/osx/Info.plist index 99189ba..74b8c2e 100644 --- a/tools/osx/Info.plist +++ b/tools/osx/Info.plist @@ -9,9 +9,9 @@ CFBundleIconFile Tippy.icns CFBundleVersion - 0.3.1 + 0.3.2 CFBundleShortVersionString - 0.3.1 + 0.3.2 CFBundleExecutable main CFBundleInfoDictionaryVersion