]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tools/cli.ts
Translated using Weblate (Japanese)
[github/Chocobozzz/PeerTube.git] / server / tools / cli.ts
index 671b56ed0819650b9128cad9f874fafb943e1972..4607d052a9a19051fe0b9c009a0a85aa08f4bdb8 100644 (file)
@@ -20,7 +20,7 @@ async function getAdminTokenOrDie (server: PeerTubeServer, username: string, pas
   const token = await server.login.getAccessToken(username, password)
   const me = await server.users.getMyInfo({ token })
 
-  if (me.role !== UserRole.ADMINISTRATOR) {
+  if (me.role.id !== UserRole.ADMINISTRATOR) {
     console.error('You must be an administrator.')
     process.exit(-1)
   }
@@ -73,10 +73,10 @@ function getRemoteObjectOrDie (
 ): { url: string, username: string, password: string } {
   const options = program.opts()
 
-  function exitIfNoOptions (options: string[], errorPrefix: string = '') {
+  function exitIfNoOptions (optionNames: string[], errorPrefix: string = '') {
     let exit = false
 
-    for (const key of options) {
+    for (const key of optionNames) {
       if (!options[key]) {
         if (exit === false && errorPrefix) console.error(errorPrefix)