password: program['password']
}
- run(user, program['url']).catch(err => console.error(err))
+ run(user, program['url'])
+ .catch(err => {
+ console.error(err)
+ process.exit(-1)
+ })
})
async function promptPassword () {
secret: res.body.client_secret
}
- const res2 = await login(url, client, user)
- accessToken = res2.body.access_token
+ try {
+ const res = await login(program[ 'url' ], client, user)
+ accessToken = res.body.access_token
+ } catch (err) {
+ throw new Error('Cannot authenticate. Please check your username/password.')
+ }
const youtubeDL = await safeGetYoutubeDL()
### CLI wrapper
-The wrapper provides a convenient interface to the following scripts. You can access it as `peertube` via an alias in your `.bashrc` like `alias peertube="node /your/peertube/directory/dist/server/tools/peertube.js"`:
+The wrapper provides a convenient interface to the following scripts.
+You can access it as `peertube` via an alias in your `.bashrc` like `alias peertube="cd /your/peertube/directory/ && node ./dist/server/tools/peertube.js"` (you have to keep the `cd` command):
```
Usage: peertube [command] [options]