Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openscan/hardhat-plugin",
"version": "1.0.1",
"version": "1.0.2",
"description": "Hardhat 3 plugin to use openscan explorer",
"license": "MIT",
"type": "module",
Expand Down
5 changes: 3 additions & 2 deletions packages/plugin/src/hooks/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ async function startWebapp() {
// Check if port 3030 is available (fail fast)
const portAvailable = await isPortAvailable();
if (!portAvailable) {
throw new Error(
"Port 3030 is already in use. Please free the port and try again.",
console.warn(
"[openscan] Warning: Port 3030 is already in use. Explorer not started.",
);
return;
}

// Create deployment tracker and start server
Expand Down
7 changes: 4 additions & 3 deletions packages/plugin/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,17 @@ export async function isPortAvailable(): Promise<boolean> {
export async function openBrowser(url: string): Promise<void> {
const platform = process.platform;
let command: string;
const networkPageUrl = `${url}/#/31337`;

switch (platform) {
case "darwin": // macOS
command = `open "${url}"`;
command = `open "${networkPageUrl}"`;
break;
case "win32": // Windows
command = `start "" "${url}"`;
command = `start "" "${networkPageUrl}"`;
break;
default: // Linux and others
command = `xdg-open "${url}"`;
command = `xdg-open "${networkPageUrl}"`;
break;
}

Expand Down