Skip to content

Commit 0a82ef7

Browse files
committed
fix: Only output the encoded context to stdout
1 parent 48bca56 commit 0a82ef7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

example/tests/context.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,23 @@ function runWithRetry(cmd, maxRetries = 30, delay = 1000) {
4141

4242
try {
4343
// Read lnd macaroon with retry
44-
console.log('Waiting for LND macaroon...');
44+
console.error('Waiting for LND macaroon...');
4545
const lndmacaroon = readFileWithRetry('docker/lnd/admin.macaroon')
4646
.toString('hex')
4747
.toUpperCase();
48-
console.log('LND macaroon loaded successfully');
48+
console.error('LND macaroon loaded successfully');
4949

5050
// Run command to read clightning rune with retry
51-
console.log('Waiting for CLightning to be ready...');
51+
console.error('Waiting for CLightning to be ready...');
5252
const clightning = runWithRetry(
5353
'cd docker; docker compose exec --user clightning clightning lightning-cli createrune --regtest',
5454
);
5555
const lcrune = JSON.parse(clightning).rune;
56-
console.log('CLightning rune generated successfully');
56+
console.error('CLightning rune generated successfully');
5757

5858
const context = { lndmacaroon, lcrune };
5959
const encoded = Buffer.from(JSON.stringify(context)).toString('hex');
60+
// Only output the encoded context to stdout - everything else goes to stderr
6061
console.log(encoded);
6162
} catch (error) {
6263
console.error('Failed to prepare test context:', error.message);

0 commit comments

Comments
 (0)