overleaf/services/web/scripts/add_git_bridge_feature.js
Shane Kilkelly 81b09c7800 Merge pull request #1071 from sharelatex/sk-enable-git-bridge-in-v2
Enable git-bridge in v2

GitOrigin-RevId: 24586c7c80b53ae171199ecde538df794f78ecc7
2018-11-14 11:29:35 +00:00

25 lines
554 B
JavaScript

const { db } = require('../app/js/infrastructure/mongojs')
const logger = require('logger-sharelatex')
logger.logger.level('error')
logger.log({}, 'Updating users in mongo')
db.users.update(
{
'features.github': true
},
{
$set: { 'features.gitBridge': true }
},
function(err, result) {
if (err) {
logger.err({ err: err, result: result }, 'Error updating users in mongo')
return
}
logger.log(
{ result: result },
'Updated users who have github to have gitBridge too'
)
process.exit(0)
}
)