diff options
author | Chocobozzz <me@florianbigard.com> | 2019-11-04 16:34:58 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-11-04 16:34:58 +0100 |
commit | bcd4cf0586ac376c272e7d7e24dbeb821aac579d (patch) | |
tree | 1de278b4963b21d7945fb40becbbd66684cc105a /server | |
parent | e128425b7b0e02bb9e1357e58a3e51970a8e26e7 (diff) | |
download | PeerTube-bcd4cf0586ac376c272e7d7e24dbeb821aac579d.tar.gz PeerTube-bcd4cf0586ac376c272e7d7e24dbeb821aac579d.tar.zst PeerTube-bcd4cf0586ac376c272e7d7e24dbeb821aac579d.zip |
Fix remove end slash function
Diffstat (limited to 'server')
-rw-r--r-- | server/tools/peertube-import-videos.ts | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/server/tools/peertube-import-videos.ts b/server/tools/peertube-import-videos.ts index 39184f46d..3c41a6c0c 100644 --- a/server/tools/peertube-import-videos.ts +++ b/server/tools/peertube-import-videos.ts | |||
@@ -57,8 +57,8 @@ getServerCredentials(command) | |||
57 | exitError('--tmpdir %s: directory does not exist or is not accessible', program[ 'tmpdir' ]) | 57 | exitError('--tmpdir %s: directory does not exist or is not accessible', program[ 'tmpdir' ]) |
58 | } | 58 | } |
59 | 59 | ||
60 | removeEndSlashes(url) | 60 | url = removeEndSlashes(url) |
61 | removeEndSlashes(program[ 'targetUrl' ]) | 61 | program[ 'targetUrl' ] = removeEndSlashes(program[ 'targetUrl' ]) |
62 | 62 | ||
63 | const user = { username, password } | 63 | const user = { username, password } |
64 | 64 | ||
@@ -330,9 +330,7 @@ function isNSFW (info: any) { | |||
330 | } | 330 | } |
331 | 331 | ||
332 | function removeEndSlashes (url: string) { | 332 | function removeEndSlashes (url: string) { |
333 | while (url.endsWith('/')) { | 333 | return url.replace(/\/+$/, '') |
334 | url.slice(0, -1) | ||
335 | } | ||
336 | } | 334 | } |
337 | 335 | ||
338 | async function promptPassword () { | 336 | async function promptPassword () { |