tokentracker-cli 0.5.73 → 0.5.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/commands/serve.js +7 -2
package/package.json
CHANGED
package/src/commands/serve.js
CHANGED
|
@@ -10,6 +10,11 @@ const { serveStaticFile } = require("../lib/static-server");
|
|
|
10
10
|
const { openInBrowser } = require("../lib/browser-auth");
|
|
11
11
|
|
|
12
12
|
const DEFAULT_PORT = 7680;
|
|
13
|
+
const NPM_PACKAGE_NAME = "tokentracker-cli";
|
|
14
|
+
|
|
15
|
+
function buildPortInUseHint(port) {
|
|
16
|
+
return `Port ${port} is still in use after cleanup. Try: npx ${NPM_PACKAGE_NAME} serve --port ${port + 1}\n`;
|
|
17
|
+
}
|
|
13
18
|
|
|
14
19
|
async function cmdServe(argv) {
|
|
15
20
|
const opts = parseArgs(argv);
|
|
@@ -133,7 +138,7 @@ async function cmdServe(argv) {
|
|
|
133
138
|
|
|
134
139
|
server.on("error", (e) => {
|
|
135
140
|
if (e.code === "EADDRINUSE") {
|
|
136
|
-
process.stderr.write(
|
|
141
|
+
process.stderr.write(buildPortInUseHint(port));
|
|
137
142
|
} else {
|
|
138
143
|
process.stderr.write(`Server error: ${e.message}\n`);
|
|
139
144
|
}
|
|
@@ -221,4 +226,4 @@ function parseArgs(argv) {
|
|
|
221
226
|
return opts;
|
|
222
227
|
}
|
|
223
228
|
|
|
224
|
-
module.exports = { cmdServe };
|
|
229
|
+
module.exports = { cmdServe, buildPortInUseHint, NPM_PACKAGE_NAME };
|