Skip to content

Commit 477c9da

Browse files
committed
feat: update cli
1 parent 9ef11bb commit 477c9da

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

packages/slidev/node/cli.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import path from 'path'
22
import http from 'http'
3+
import os from 'os'
34
import fs from 'fs-extra'
45
import yargs, { Argv } from 'yargs'
56
import prompts from 'prompts'
@@ -239,8 +240,16 @@ function printInfo(options: ResolvedSlidevOptions, port?: number) {
239240
console.log(dim(' entry ') + dim(path.dirname(options.entry) + path.sep) + path.basename(options.entry))
240241
if (port) {
241242
console.log()
242-
console.log(`${dim(' presenter mode ')} > ${blue(`http://localhost:${bold(port)}/presenter`)}`)
243243
console.log(`${dim(' slide show ')} > ${cyan(`http://localhost:${bold(port)}/`)}`)
244+
console.log(`${dim(' presenter mode ')} > ${blue(`http://localhost:${bold(port)}/presenter`)}`)
245+
246+
Object.values(os.networkInterfaces())
247+
.forEach(v => (v || [])
248+
.filter(details => details.family === 'IPv4' && !details.address.includes('127.0.0.1'))
249+
.forEach(({ address }) => {
250+
console.log(`${dim(' remote control ')} > ${blue(`http://${address}:${port}/presenter`)}`)
251+
}),
252+
)
244253
}
245254
console.log()
246255
console.log()

0 commit comments

Comments
 (0)