Browse Source

Merge branch 'master' of jeffery/elxr into master

production
chess 1 year ago
parent
commit
6f0b02c840
1 changed files with 21 additions and 11 deletions
  1. 21
    11
      index.js

+ 21
- 11
index.js View File

, noprerequisites : true , noprerequisites : true
, independentcmd : true , independentcmd : true
// , requires : [ generateDependencies ] // , requires : [ generateDependencies ]
, toArgs : function( o ){
return o
}
} }
, 'remote set-url' : { , 'remote set-url' : {
// return a interpreted set of arguments for this cmd run context. // return a interpreted set of arguments for this cmd run context.
, noprerequisites : true , noprerequisites : true
, independentcmd : true , independentcmd : true
// , requires : [ generateDependencies ] // , requires : [ generateDependencies ]
} }
, 'remote add' : { , 'remote add' : {
// return a interpreted set of arguments for this cmd run context. // return a interpreted set of arguments for this cmd run context.
var repodef = selectedinstance.reposindexed[repo]; var repodef = selectedinstance.reposindexed[repo];
if(!repodef) return if(!repodef) return
var remotenames = selectedinstance.selectedremotes.concat( selectedinstance.permanentremotes )
var remotenames = (selectedinstance.selectedremotes || []).concat( selectedinstance.permanentremotes )
var remotes = selectedinstance.reposerverinstances[selectedinstance.reposerver].remotes var remotes = selectedinstance.reposerverinstances[selectedinstance.reposerver].remotes
// console.log('-----------------------------------------------------') // console.log('-----------------------------------------------------')
// console.log(repo) // console.log(repo)
var interpretrun = function(){ var interpretrun = function(){
var cmd = processedArgs._[0]; var cmd = processedArgs._[0];
return cmds[cmd] && cmds[cmd].interpret ? cmds[cmd].interpret() : (function(){ return cmds[cmd] && cmds[cmd].interpret ? cmds[cmd].interpret() : (function(){
return cmds[cmd] = interpret.call({ cmd, toArgs : function( o ){
return cmds[cmd] = utils.assign(cmds[cmd], interpret.call({ cmd, toArgs : function( o ){
// PB : TODO -- need to call this before selectedinstance is built. The instanceName is dependent on the specific cmd. // PB : TODO -- need to call this before selectedinstance is built. The instanceName is dependent on the specific cmd.
return o } })
return o } }))
})() })()
} }


return tasq; return tasq;
} }


var remotenames = selectedinstance.selectedremotes.concat( selectedinstance.permanentremotes )
var remotenames = (selectedinstance.selectedremotes || []).concat( selectedinstance.permanentremotes )
var remotes = selectedinstance.reposerverinstances[__args.url].remotes var remotes = selectedinstance.reposerverinstances[__args.url].remotes


// use the repo manifest to create missing remotes. // use the repo manifest to create missing remotes.
if(repo === '.elxr') return Promise.resolve(true) if(repo === '.elxr') return Promise.resolve(true)
if(repo === '.git') return Promise.resolve(true) if(repo === '.git') return Promise.resolve(true)
if(repo === 'Downloads') return Promise.resolve(true) if(repo === 'Downloads') return Promise.resolve(true)
// if(repo !== 'elixir-config-development') {
// PB : TODO -- pick up remote definitions per repository...
var reposmanfiest = utils.assign_core( { keycase : true, arraymergetype : utils.assign_core.DISTINCT_UNION }
, {}, selectedinstance, loadmanifest( selectedinstance.root + '/' + repo
, { utils, username : selectedinstance.username, instanceName : selectedinstance.instanceName
, node_env : selectedinstance.node_env, reposerver : selectedinstance.reposerver }
))
// }
// else {
// var reposmanfiest= { error : 'Already lodeded elixir-config-development'}
// }


// PB : TODO -- pick up remote definitions per repository...
var reposmanfiest = utils.assign_core( { keycase : true, arraymergetype : utils.assign_core.DISTINCT_UNION }
, {}, selectedinstance, loadmanifest( selectedinstance.root + '/' + repo
, { utils, username : selectedinstance.username, instanceName : selectedinstance.instanceName
, node_env : selectedinstance.node_env, reposerver : selectedinstance.reposerver }
))


if( !reposmanfiest.error ) { if( !reposmanfiest.error ) {
var reporemotenames = remotenames.concat(reposmanfiest.selectedremotes || []).concat( reposmanfiest.permanentremotes || [] ) var reporemotenames = remotenames.concat(reposmanfiest.selectedremotes || []).concat( reposmanfiest.permanentremotes || [] )
var reporemotes = utils.assign(remotes, reposmanfiest.reposerverinstances[___args.url].remotes)
var reporemotes = utils.assign([], remotes, reposmanfiest.reposerverinstances[___args.url].remotes)
} }
else { else {
var reporemotenames = remotenames var reporemotenames = remotenames

Loading…
Cancel
Save