Add managed desktop daemon runtime support
This commit is contained in:
@@ -289,7 +289,12 @@ export function resolveTcpHostFromListen(listen: string): string | null {
|
||||
return null
|
||||
}
|
||||
|
||||
if (normalized.startsWith('/') || normalized.startsWith('unix://')) {
|
||||
if (
|
||||
normalized.startsWith('/') ||
|
||||
normalized.startsWith('unix://') ||
|
||||
normalized.startsWith('pipe://') ||
|
||||
normalized.startsWith('\\\\.\\pipe\\')
|
||||
) {
|
||||
return null
|
||||
}
|
||||
|
||||
|
||||
@@ -4,14 +4,16 @@ import { generateLocalPairingOffer, loadConfig, resolvePaseoHome } from '@getpas
|
||||
|
||||
interface PairOptions {
|
||||
home?: string
|
||||
json?: boolean
|
||||
}
|
||||
|
||||
export function pairCommand(): Command {
|
||||
return new Command('pair')
|
||||
.description('Print the daemon pairing QR code and link')
|
||||
.option('--json', 'Output in JSON format')
|
||||
.option('--home <path>', 'Paseo home directory (default: ~/.paseo)')
|
||||
.action(async (options: PairOptions) => {
|
||||
await runPairCommand(options)
|
||||
.action(async (_options: PairOptions, command: Command) => {
|
||||
await runPairCommand(command.optsWithGlobals() as PairOptions)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -37,6 +39,21 @@ export async function runPairCommand(options: PairOptions): Promise<void> {
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
if (options.json) {
|
||||
process.stdout.write(
|
||||
`${JSON.stringify(
|
||||
{
|
||||
relayEnabled: pairing.relayEnabled,
|
||||
url: pairing.url,
|
||||
qr: pairing.qr,
|
||||
},
|
||||
null,
|
||||
2
|
||||
)}\n`
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
const qrBlock = pairing.qr ? `${pairing.qr}\n` : ''
|
||||
process.stdout.write(`\nScan to pair:\n${qrBlock}${pairing.url}\n`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user