peertube-plugin-livechat/server/lib/diagnostic/prosody.ts

19 lines
562 B
TypeScript
Raw Normal View History

2021-04-12 18:52:21 +00:00
import { getWorkingDir } from '../prosody/config'
import { newResult, TestResult } from './utils'
2021-04-12 18:52:21 +00:00
export async function diagProsody (test: string, options: RegisterServerOptions): Promise<TestResult> {
const result = newResult(test)
result.label = 'Builtin Prosody and ConverseJS'
2021-04-12 18:52:21 +00:00
try {
const dir = await getWorkingDir(options)
result.messages.push('The working dir is: ' + dir)
} catch (error) {
result.messages.push('Error when requiring the working dir: ' + (error as string))
return result
}
result.ok = true
return result
}