mirror of
https://github.com/aljazceru/gitpear.git
synced 2025-12-17 14:14:22 +01:00
remote-acl: list (cleaner)
Signed-off-by: dzdidi <deniszalessky@gmail.com>
This commit is contained in:
35
src/utils.js
Normal file
35
src/utils.js
Normal file
@@ -0,0 +1,35 @@
|
||||
|
||||
function printACL(repoACL) {
|
||||
console.log('Repo Visibility:', '\t', repoACL.visibility)
|
||||
console.log('Protected Branch(s):', '\t', repoACL.protectedBranches.join(', '))
|
||||
console.log('User:', '\t', 'Role:')
|
||||
for (const user in repoACL.ACL) {
|
||||
console.log(user, '\t', repoACL.ACL[user])
|
||||
}
|
||||
}
|
||||
|
||||
function printACLForUser(repoACL, u) {
|
||||
console.log('Repo Visibility:', '\t', repoACL.visibility)
|
||||
console.log('Protected Branch(s):', '\t', repoACL.protectedBranches.join(', '))
|
||||
console.log('User:', u, '\t', repoACL.ACL[u])
|
||||
}
|
||||
|
||||
function checkIfGitRepo(p) {
|
||||
if (!fs.existsSync(path.join(p, '.git'))) {
|
||||
console.error('Not a git repo')
|
||||
process.exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
function logBranches(repoACL) {
|
||||
console.log('Repo Visibility:', '\t', repoACL.visibility)
|
||||
console.log('Protected Branch(s):', '\t', repoACL.protectedBranches.join(', '))
|
||||
}
|
||||
|
||||
|
||||
|
||||
module.exports = {
|
||||
printACL,
|
||||
checkIfGitRepo,
|
||||
logBranches,
|
||||
}
|
||||
Reference in New Issue
Block a user