Browse Source

elxr pull fixes

master
pb 2 years ago
parent
commit
7375dd7b7a
1 changed files with 31 additions and 22 deletions
  1. 31
    22
      index.js

+ 31
- 22
index.js View File

@@ -16,7 +16,7 @@ var Tasq = utils.Tasq
var statuslog = utils.Traq
var Traq = utils.Traq
// console.error('EEEEEEEEEEEEEEEEEEEE')
var util = require('util')

var ENV = Object.assign({}, process.env); // Shallow clone so we can set values and reuse for reshelling spawns.
const cliargs = utils.cliargs;
@@ -128,6 +128,10 @@ shell_verse.acquireElevationState().then((isElevated) => {
// wd is our own environment variable probably corresponding to the root but need not be the same.
// console.log(processedArgs.root)
// console.log('PWD :' + ENV.PWD)
// console.log('cwd : ' + process.cwd())
// console.log('launchscriptdir : ' + path.normalize(__dirname))

if(!processedArgs.root){
if(!process.env.wd){
console.log('discovery')
@@ -324,7 +328,6 @@ shell_verse.acquireElevationState().then((isElevated) => {
, noprerequisites : true
, independentcmd : true
// , requires : [ generateDependencies ]
}
, 'remote add' : {
// return a interpreted set of arguments for this cmd run context.
@@ -354,7 +357,7 @@ shell_verse.acquireElevationState().then((isElevated) => {
var repodef = selectedinstance.reposindexed[repo];
if(!repodef) return
var remotenames = (selectedinstance.selectedremotes || []).concat( selectedinstance.permanentremotes )
var remotenames = selectedinstance.selectedremotes.concat( selectedinstance.permanentremotes )
var remotes = selectedinstance.reposerverinstances[selectedinstance.reposerver].remotes
// console.log('-----------------------------------------------------')
// console.log(repo)
@@ -566,7 +569,7 @@ shell_verse.acquireElevationState().then((isElevated) => {
var interpretrun = function(){
var cmd = processedArgs._[0];
return cmds[cmd] && cmds[cmd].interpret ? cmds[cmd].interpret() : (function(){
return cmds[cmd] = utils.assign(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.
return o } }))
})()
@@ -1627,19 +1630,13 @@ shell_verse.acquireElevationState().then((isElevated) => {
if(repo === '.elxr') return Promise.resolve(true)
if(repo === '.git') 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 ) {
var reporemotenames = remotenames.concat(reposmanfiest.selectedremotes || []).concat( reposmanfiest.permanentremotes || [] )
@@ -3921,9 +3918,15 @@ shell_verse.acquireElevationState().then((isElevated) => {
var regularpulltasks = function(){
var pendingpulls = [];
def.repos.forEach((def) => {
pendingpulls.push(
performPull(def).then(()=>{ console.log('pulled ' + JSON.stringify(def.repo)) })
.catch(e => { console.log(e); throw e })
pendingpulls.push(
function(){
// if(def.repo === 'setup') return;
// if(def.repo !== 'chess-client-lib') return;
return performPull(def).then(()=>{ console.log('pulled ' + JSON.stringify(def.repo)) })
.catch(e => {
console.error(util.inspect(e)); throw e })
}
)
})
return any(pendingpulls).finally(Traq.finally)
@@ -4188,10 +4191,16 @@ shell_verse.acquireElevationState().then((isElevated) => {


function resetgitconfig(){

// https://stackoverflow.com/questions/37182847/how-do-i-disable-git-credential-manager-for-windows
// use git config --edit --system to remove the helper = manager line so that it is no longer registered as a credential helper.
// For bonus points, use git config --edit --global and insert:
// [core]
// askpass =
// https://git-scm.com/book/en/v2/Git-Tools-Credential-Storage
// Git Credential storage...
// git config --global credential.helper 'store --file ~/.gitcredentials'
// git config --global credential.helper 'store --file ~/.elxrcredentials'
// git credential fill
// protocol=https
// host=git.bbh.org.in
@@ -4617,7 +4626,7 @@ shell_verse.acquireElevationState().then((isElevated) => {
}
})
.catch((e)=>{
console.log(e)
console.error(e)
return __onResult(e)
})
}

Loading…
Cancel
Save