mirror of
https://github.com/aljazceru/gitpear.git
synced 2025-12-17 14:14:22 +01:00
cli: path as option; lint; quit option
Signed-off-by: dzdidi <deniszalessky@gmail.com>
This commit is contained in:
16
src/utils.js
16
src/utils.js
@@ -1,7 +1,7 @@
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
|
||||
function printACL(repoACL) {
|
||||
function printACL (repoACL) {
|
||||
console.log('Repo Visibility:', '\t', repoACL.visibility)
|
||||
console.log('Protected Branch(s):', '\t', repoACL.protectedBranches.join(', '))
|
||||
console.log('User:', '\t', 'Role:')
|
||||
@@ -10,20 +10,20 @@ function printACL(repoACL) {
|
||||
}
|
||||
}
|
||||
|
||||
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 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) {
|
||||
function checkIfGitRepo (p) {
|
||||
if (!fs.existsSync(path.join(p, '.git'))) {
|
||||
console.error(` ${p} is not a git repo`)
|
||||
process.exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
function logBranches(repoACL) {
|
||||
function logBranches (repoACL) {
|
||||
console.log('Repo Visibility:', '\t', repoACL.visibility)
|
||||
console.log('Protected Branch(s):', '\t', repoACL.protectedBranches.join(', '))
|
||||
}
|
||||
@@ -32,5 +32,5 @@ module.exports = {
|
||||
printACL,
|
||||
printACLForUser,
|
||||
checkIfGitRepo,
|
||||
logBranches,
|
||||
logBranches
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user