Skip to content

Commit 070f41d

Browse files
committed
Don't let the port check block things in dev mode
1 parent f27bf7e commit 070f41d

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"build:electron": "ts-node ./setup-server.ts && electron-builder build",
1414
"build:dir-only": "ts-node ./setup-server.ts && electron-builder --dir",
1515
"start": "ts-node ./setup-server.ts && npm run start:app",
16-
"start:dev": "ts-node ./skip-server.ts && cross-env APP_URL='http://local.httptoolkit.tech:8080' npm run start:app",
16+
"start:dev": "ts-node ./skip-server.ts && cross-env HTK_DEV=true APP_URL='http://local.httptoolkit.tech:8080' npm run start:app",
1717
"start:app": "tsc-watch --onSuccess 'electron .'"
1818
},
1919
"keywords": [],

src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ const packageJson = require('../package.json');
4141

4242
const isWindows = os.platform() === 'win32';
4343

44+
const DEV_MODE = process.env.HTK_DEV === 'true';
4445
const APP_URL = process.env.APP_URL || 'https://app.httptoolkit.tech';
4546
const AUTH_TOKEN = uuid();
4647
const DESKTOP_VERSION = packageJson.version;
@@ -439,6 +440,7 @@ if (!amMainInstance) {
439440

440441
const portCheck = checkServerPortAvailable('127.0.0.1', 45457)
441442
.catch(async () => {
443+
if (DEV_MODE) return; // In full dev mode this is OK & expected
442444
await appReady.promise;
443445

444446
showErrorAlert(

0 commit comments

Comments
 (0)