はじまりの大地

このコミットが含まれているのは:
2024-07-15 09:14:04 +09:00
コミット 6632905f32
3501個のファイルの変更1439465行の追加0行の削除
+30
ファイルの表示
@@ -0,0 +1,30 @@
import prompt from 'prompt'
export async function askConfirmation (message: string) {
return new Promise((res, rej) => {
prompt.start()
const schema = {
properties: {
confirm: {
type: 'string',
description: message + ' (y/n)',
default: 'n',
validator: /y[es]*|n[o]?/,
warning: 'Must respond yes or no',
required: true
}
}
}
prompt.get(schema, function (err, result) {
if (err) return rej(err)
return res(result.confirm?.match(/y/) !== null)
})
})
}
export function displayPeerTubeMustBeStoppedWarning () {
console.log(`/!\\ PeerTube must be stopped before running this script /!\\\n`)
}