remove eventual trailing '/' at the end of urls in import script (see #1453)
This commit is contained in:
parent
7f3d712d5e
commit
ab4dbe3657
1 changed files with 10 additions and 0 deletions
|
@ -58,6 +58,7 @@ getSettings()
|
|||
settings.remotes[settings.default] :
|
||||
settings.remotes[0]
|
||||
}
|
||||
|
||||
if (!program['username']) program['username'] = netrc.machines[program['url']].login
|
||||
if (!program['password']) program['password'] = netrc.machines[program['url']].password
|
||||
}
|
||||
|
@ -69,6 +70,9 @@ getSettings()
|
|||
process.exit(-1)
|
||||
}
|
||||
|
||||
removeEndSlashes(program['url'])
|
||||
removeEndSlashes(program['targetUrl'])
|
||||
|
||||
const user = {
|
||||
username: program['username'],
|
||||
password: program['password']
|
||||
|
@ -321,3 +325,9 @@ function isNSFW (info: any) {
|
|||
|
||||
return false
|
||||
}
|
||||
|
||||
function removeEndSlashes (url: string) {
|
||||
while (url.endsWith('/')) {
|
||||
url.slice(0, -1)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue