projects
/
oweals
/
peertube.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e128425
)
Fix remove end slash function
author
Chocobozzz
<me@florianbigard.com>
Mon, 4 Nov 2019 15:34:58 +0000
(16:34 +0100)
committer
Chocobozzz
<me@florianbigard.com>
Mon, 4 Nov 2019 15:34:58 +0000
(16:34 +0100)
server/tools/peertube-import-videos.ts
patch
|
blob
|
history
diff --git
a/server/tools/peertube-import-videos.ts
b/server/tools/peertube-import-videos.ts
index 39184f46d5d4ea520705ca7d22c27faa111945ad..3c41a6c0c097393d445c45c8d0d641a8dbf40d03 100644
(file)
--- a/
server/tools/peertube-import-videos.ts
+++ b/
server/tools/peertube-import-videos.ts
@@
-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 () {