Styling
This commit is contained in:
parent
8e76aa1d75
commit
24198e976f
1 changed files with 9 additions and 6 deletions
|
@ -46,6 +46,15 @@ function isURLaPeerTubeInstance (url: string) {
|
|||
return url.startsWith('http://') || url.startsWith('https://')
|
||||
}
|
||||
|
||||
function stripExtraneousFromPeerTubeUrl (url: string) {
|
||||
// Get everything before the 3rd /.
|
||||
const urlLength = url.includes('/', 8)
|
||||
? url.indexOf('/', 8)
|
||||
: url.length
|
||||
|
||||
return url.substr(0, urlLength)
|
||||
}
|
||||
|
||||
program
|
||||
.name('auth')
|
||||
.usage('[command] [options]')
|
||||
|
@ -80,12 +89,6 @@ program
|
|||
}
|
||||
}
|
||||
}, async (_, result) => {
|
||||
const stripExtraneousFromPeerTubeUrl = function (url: string) {
|
||||
// Get everything before the 3rd /.
|
||||
const urlLength: number = url.includes('/', 8) ? url.indexOf('/', 8) : url.length
|
||||
|
||||
return url.substr(0, urlLength)
|
||||
}
|
||||
|
||||
// Check credentials
|
||||
try {
|
||||
|
|
Loading…
Reference in a new issue