default: number
}
-function getSettings () {
- return new Promise<Settings>((res, rej) => {
- const defaultSettings = {
- remotes: [],
- default: -1
- }
+async function getSettings (): Promise<Settings> {
+ const defaultSettings = {
+ remotes: [],
+ default: -1
+ }
- config.read((err, data) => {
- if (err) return rej(err)
+ const data = await config.read()
- return res(Object.keys(data).length === 0 ? defaultSettings : data)
- })
- })
+ return Object.keys(data).length === 0
+ ? defaultSettings
+ : data
}
async function getNetrc () {
return netrc
}
-function writeSettings (settings) {
- return new Promise((res, rej) => {
- config.write(settings, err => {
- if (err) return rej(err)
-
- return res()
- })
- })
+function writeSettings (settings: Settings) {
+ return config.write(settings)
}
function deleteSettings () {
- return new Promise((res, rej) => {
- config.trash((err) => {
- if (err) return rej(err)
-
- return res()
- })
- })
+ return config.trash()
}
function getRemoteObjectOrDie (
.option('-d, --video-description <description>', 'Video description')
.option('-P, --privacy <privacy_number>', 'Privacy')
.option('-C, --channel-name <channel_name>', 'Channel name')
- .option('-m, --comments-enabled', 'Enable comments')
+ .option('--no-comments-enabled', 'Disable video comments')
.option('-s, --support <support>', 'Video support text')
- .option('-w, --wait-transcoding', 'Wait transcoding before publishing the video')
+ .option('--no-wait-transcoding', 'Do not wait transcoding before publishing the video')
+ .option('--no-download-enabled', 'Disable video download')
.option('-v, --verbose <verbose>', 'Verbosity, from 0/\'error\' to 4/\'debug\'', 'info')
}
export {
version,
- config,
getLogger,
getSettings,
getNetrc,