|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170 |
- module.exports = ((meta, options)=>{
-
- var name = meta.name
- const utils = meta.utils
-
- options = options || { username : `guest`, reposerver : `https://git.bbh.org.in`, password : `noneforguest` }
-
-
- var users = [
- { username : `${options.username}`, password : `${options.password}` }
- , { username : `guest`}
-
-
- ]
-
-
-
-
-
- var remotes = {
- 'chess' : {
- priority : 0,
-
- server : `${options.reposerver}`, user : { username : options.username || ''}, path : ``
- , get url(){ return `${this.server}/${this.owner}`}
- , push : 'no-pushing'
- , title : 'chess'
- , get username(){ return this.user.username }
- , owner : 'chess'
- }
- , 'chess-public' : { priority : 1,
- server : `https://git.bbh.org.in`, user : { username : options.username || ''}, path : ``
- , get url(){ return `${this.server}/${this.owner}`}
- , title : 'chess-public'
- , accessibility : ['public']
- , push : 'no-pushing'
- , get username(){ return this.user.username }
- , owner : 'chess'
- }
-
- , 'chess-private' : { priority : 2,
- server : `http://git.bbh`, user : { username : options.username || ''}, path : ``
- , get url(){ return `${this.server}/${this.owner}`}
- , title : 'chess-private'
- , accessibility : ['private']
- , push : 'no-pushing', private : true
- , get username(){ return this.user.username }
- , owner : 'chess'
- }
- , 'chess-github' : { priority : 3,
- server : `https://github.com`, user : { username : 'baptistdev'}, path : ``
- , get url(){ return `${this.server}/${this.owner}`}
- , title : 'chess-github'
- , accessibility : ['public']
- , push : 'no-pushing'
- , get username(){ return this.user.username }
- , owner : 'chess'
- }
- }
-
-
-
-
-
-
- if(options.username) {
- utils.assign_core( { arraymergetype : utils.assign_core.DISTINCT_UNION }
- , remotes
- , { 'userfork' : {
- priority : 1,
- server : `${options.reposerver}`, user : { username : `${options.username}`}, path : ``
- , get url(){ return `${this.server}/${this.user.username}`}
- , title : 'userfork'
- , get username(){ return this.user.username }
- , get owner(){ return this.username }
- , pushable : true
- }
- , 'userfork-public' : {
- priority : 1,
- server : `https://git.bbh.org.in`, user : {username : `${options.username}`}, path : ``
- , get url(){ return `${this.server}/${this.user.username}`}
-
- , title : 'userfork-public'
- , accessibility : ['public']
- , get username(){ return this.user.username }
- , get owner(){ return this.username }
- , pushable : true
- }
-
- , 'userfork-private' : { priority : 2,
- server : `http://git.bbh`, user : { username : options.username || ''}, path : ``
- , get url(){ return `${this.server}/${this.user.username}`}
- , title : 'userfork-private'
- , accessibility : ['private']
- , get username(){ return this.user.username }
- , get owner(){ return this.username }
- }
- , 'userfork-unc' : {
- priority : 3,
- server : `//172.16.0.27/repos`, user : { username : `${options.username}`}, path : ``
- , get url(){ return `${this.server}/${this.user.username}`}
- , title : 'userfork-unc'
- , accessibility : ['unc']
-
- , get username(){ return this.user.username }
- , get owner(){ return this.username }
- , pushable : true
- }
- }
- )
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var reposerverinstances = {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- }
-
- Object.keys(remotes).forEach(
- (k) => {
- var v = remotes[k]
-
-
- reposerverinstances[v.server] = reposerverinstances[v.server] || { users : [], remotes : {} };
- utils.assign_core( { arraymergetype : utils.assign_core.DISTINCT_UNION }
- , reposerverinstances[v.server].users, v.users || [v.user] )
-
-
- reposerverinstances[v.server].remotes[k] = v;
- }
- )
-
- return {
-
-
- reposervers : Object.keys(reposerverinstances)
- , reposerverinstances
- , remotes
- , repos : [
- { repo : 'elxr' }
- ]
- }
- })
|