Fix remove end slash function

pull/2227/head
Chocobozzz 2019-11-04 16:34:58 +01:00
parent e128425b7b
commit bcd4cf0586
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 3 additions and 5 deletions

View File

@ -57,8 +57,8 @@ getServerCredentials(command)
exitError('--tmpdir %s: directory does not exist or is not accessible', program[ 'tmpdir' ])
}
removeEndSlashes(url)
removeEndSlashes(program[ 'targetUrl' ])
url = removeEndSlashes(url)
program[ 'targetUrl' ] = removeEndSlashes(program[ 'targetUrl' ])
const user = { username, password }
@ -330,9 +330,7 @@ function isNSFW (info: any) {
}
function removeEndSlashes (url: string) {
while (url.endsWith('/')) {
url.slice(0, -1)
}
return url.replace(/\/+$/, '')
}
async function promptPassword () {