Skip to content

Commit 9b768c6

Browse files
authored
Merge pull request #6 from MatiasOS/release/1-0-2
v1.0.2
2 parents 132d314 + 4109d64 commit 9b768c6

3 files changed

Lines changed: 8 additions & 6 deletions

File tree

packages/plugin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openscan/hardhat-plugin",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "Hardhat 3 plugin to use openscan explorer",
55
"license": "MIT",
66
"type": "module",

packages/plugin/src/hooks/network.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ async function startWebapp() {
2828
// Check if port 3030 is available (fail fast)
2929
const portAvailable = await isPortAvailable();
3030
if (!portAvailable) {
31-
throw new Error(
32-
"Port 3030 is already in use. Please free the port and try again.",
31+
console.warn(
32+
"[openscan] Warning: Port 3030 is already in use. Explorer not started.",
3333
);
34+
return;
3435
}
3536

3637
// Create deployment tracker and start server

packages/plugin/src/utils.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,17 @@ export async function isPortAvailable(): Promise<boolean> {
3232
export async function openBrowser(url: string): Promise<void> {
3333
const platform = process.platform;
3434
let command: string;
35+
const networkPageUrl = `${url}/#/31337`;
3536

3637
switch (platform) {
3738
case "darwin": // macOS
38-
command = `open "${url}"`;
39+
command = `open "${networkPageUrl}"`;
3940
break;
4041
case "win32": // Windows
41-
command = `start "" "${url}"`;
42+
command = `start "" "${networkPageUrl}"`;
4243
break;
4344
default: // Linux and others
44-
command = `xdg-open "${url}"`;
45+
command = `xdg-open "${networkPageUrl}"`;
4546
break;
4647
}
4748

0 commit comments

Comments
 (0)