Commit 8cb04077 authored by ChaiShushan's avatar ChaiShushan Committed by Brad Fitzpatrick

misc/pprof: support web profiles on windows/MinGW

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/117060043
parent e91704af
...@@ -724,18 +724,24 @@ sub RunWeb { ...@@ -724,18 +724,24 @@ sub RunWeb {
my $fname = shift; my $fname = shift;
print STDERR "Loading web page file:///$fname\n"; print STDERR "Loading web page file:///$fname\n";
if (`uname` =~ /Darwin/) { my $uname = `uname`;
if ($uname =~ /Darwin/) {
# OS X: open will use standard preference for SVG files. # OS X: open will use standard preference for SVG files.
system("/usr/bin/open", $fname); system("/usr/bin/open", $fname);
return; return;
} }
if (`uname` =~ /CYGWIN/) { if ($uname =~ /CYGWIN/) {
# Windows(cygwin): open will use standard preference for SVG files. # Windows(cygwin): open will use standard preference for SVG files.
my $winname = `cygpath -wa $fname`; my $winname = `cygpath -wa $fname`;
system("explorer.exe", $winname); system("explorer.exe", $winname);
return; return;
} }
if ($uname =~ /MINGW/) {
# Windows(MinGW): open will use standard preference for SVG files.
system("cmd", "/c", "start", $fname);
return;
}
# Some kind of Unix; try generic symlinks, then specific browsers. # Some kind of Unix; try generic symlinks, then specific browsers.
# (Stop once we find one.) # (Stop once we find one.)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment