@browserbridge/bbx 1.14.0 → 1.14.1
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
CHANGED
|
@@ -52,7 +52,7 @@ export function printCallResponse(response, method) {
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
/**
|
|
55
|
-
* @returns {void}
|
|
55
|
+
* @returns {Promise<void>}
|
|
56
56
|
*/
|
|
57
57
|
export function printUsage() {
|
|
58
58
|
const blocks = ['Usage: bbx [--remote <name>] <command> [args]'];
|
|
@@ -60,5 +60,11 @@ export function printUsage() {
|
|
|
60
60
|
blocks.push('', `${section.title}:`);
|
|
61
61
|
blocks.push(...section.lines.map((line) => ` ${line}`));
|
|
62
62
|
}
|
|
63
|
-
|
|
63
|
+
// Wait for piped output to flush before the CLI exits.
|
|
64
|
+
return new Promise((resolve, reject) => {
|
|
65
|
+
process.stdout.write(`${blocks.join('\n')}\n`, (error) => {
|
|
66
|
+
if (error) reject(error);
|
|
67
|
+
else resolve();
|
|
68
|
+
});
|
|
69
|
+
});
|
|
64
70
|
}
|
|
@@ -101,7 +101,7 @@ const remoteDestinationId =
|
|
|
101
101
|
: (remoteFlag.remoteId ?? process.env[REMOTE_ENV] ?? null);
|
|
102
102
|
|
|
103
103
|
if (!command || ['help', '--help', '-h'].includes(command)) {
|
|
104
|
-
printUsage();
|
|
104
|
+
await printUsage();
|
|
105
105
|
process.exit(0);
|
|
106
106
|
}
|
|
107
107
|
|
|
@@ -794,7 +794,7 @@ async function main() {
|
|
|
794
794
|
}
|
|
795
795
|
|
|
796
796
|
process.stderr.write(`Unknown command: ${command}\n`);
|
|
797
|
-
printUsage();
|
|
797
|
+
await printUsage();
|
|
798
798
|
process.exitCode = 1;
|
|
799
799
|
} catch (error) {
|
|
800
800
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -235,6 +235,18 @@ async function ensureStoredBridgeAuthToken(tokenPath, options) {
|
|
|
235
235
|
owner = await readFile(lockPath, 'utf8');
|
|
236
236
|
} catch (error) {
|
|
237
237
|
if (isMissingFileError(error)) continue;
|
|
238
|
+
// Windows can report EPERM while a competing owner deletes the lock.
|
|
239
|
+
// Retry within the same bounded acquisition loop, then recheck the winner.
|
|
240
|
+
if (
|
|
241
|
+
process.platform === 'win32' &&
|
|
242
|
+
error &&
|
|
243
|
+
typeof error === 'object' &&
|
|
244
|
+
'code' in error &&
|
|
245
|
+
error.code === 'EPERM'
|
|
246
|
+
) {
|
|
247
|
+
await new Promise((resolve) => setTimeout(resolve, 10));
|
|
248
|
+
continue;
|
|
249
|
+
}
|
|
238
250
|
throw error;
|
|
239
251
|
}
|
|
240
252
|
const match = /^(\d+):([0-9a-f-]{36})\n$/u.exec(owner);
|