From 5df708ac9f6c523b3035912403cef66cf788d62e Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 9 Apr 2019 04:09:34 +0900 Subject: [PATCH] Delete mark-admin.js --- cli/mark-admin.js | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 cli/mark-admin.js diff --git a/cli/mark-admin.js b/cli/mark-admin.js deleted file mode 100644 index e10035fde9..0000000000 --- a/cli/mark-admin.js +++ /dev/null @@ -1,23 +0,0 @@ -const mongo = require('mongodb'); -const User = require('../built/models/user').default; - -const args = process.argv.slice(2); - -const user = args[0]; - -const q = user.startsWith('@') ? { - username: user.split('@')[1], - host: user.split('@')[2] || null -} : { _id: new mongo.ObjectID(user) }; - -console.log(`Mark as admin ${user}...`); - -User.update(q, { - $set: { - isAdmin: true - } -}).then(() => { - console.log(`Done ${user}`); -}, e => { - console.error(e); -});