|
|
|
|
|
|
|
|
env: process.env |
|
|
env: process.env |
|
|
, cwd: instanceroot + '/' + repo |
|
|
, cwd: instanceroot + '/' + repo |
|
|
, runas: processedArgs.runas |
|
|
, runas: processedArgs.runas |
|
|
, title: `'git', ${['config', '--replace-all', 'user.name', username].join(' ')}` |
|
|
|
|
|
|
|
|
, title: `'git', ${['config', '--replace-all', 'user.name', selectedinstance.username].join(' ')}` |
|
|
}) |
|
|
}) |
|
|
.then(() => { |
|
|
.then(() => { |
|
|
if (__isElevated) { |
|
|
if (__isElevated) { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if(e.messages.join(' ').match(new RegExp (`fatal: repository '${selectedinstance.reposerver}/${owner}/${configrepo}.git/' not found`))){ |
|
|
if(e.messages.join(' ').match(new RegExp (`fatal: repository '${selectedinstance.reposerver}/${owner}/${configrepo}.git/' not found`))){ |
|
|
return cli.prompt( { i : 'install new instance with this name locally' |
|
|
|
|
|
, f : 'fork a new instance for yourself from another instance' |
|
|
|
|
|
, o : 'fork a new instance for your organization' // prompt organization name... |
|
|
|
|
|
, c : 'create a custom personal instance for this node' // prompt hostname as nodename |
|
|
|
|
|
, p : 'create a custom personal instance' |
|
|
|
|
|
|
|
|
return cli.prompt( { |
|
|
|
|
|
t : 'install a new temporary local instance with this name' |
|
|
|
|
|
, i : 'create a new instance with this name => will fork the default config under your username' |
|
|
|
|
|
, f : 'fork a new instance with this name for yourself for this node from another instance' |
|
|
|
|
|
, o : 'fork a new instance with this name for your organization from another instance' // prompt organization name... |
|
|
|
|
|
, c : 'create a custom config for yourself for this node' // prompt hostname as nodename |
|
|
|
|
|
, p : 'create a custom config for yourself ' |
|
|
, e : 'exit'} |
|
|
, e : 'exit'} |
|
|
, 'Config for instance not found. Would you like to ', 'e' ).then(propValue => { |
|
|
, 'Config for instance not found. Would you like to ', 'e' ).then(propValue => { |
|
|
|
|
|
|
|
|
if(propValue === 'i') return eNotImplemented() // return createLocalChessInsance(selectedinstance) |
|
|
|
|
|
if(propValue === 'f') return eNotImplemented() // return createChessInstance(selectedinstance) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(propValue === 't') return eNotImplemented() |
|
|
|
|
|
if(propValue === 'i') return eNotImplemented() |
|
|
|
|
|
if(propValue === 'f') return eNotImplemented() |
|
|
|
|
|
if(propValue === 'o') return eNotImplemented() |
|
|
|
|
|
if(propValue === 'c') return eNotImplemented() // return createLocalChessInsance(selectedinstance) |
|
|
|
|
|
if(propValue === 'p') return eNotImplemented() // return createChessInstance(selectedinstance) |
|
|
// if(propValue === 'o') createChessInstance(selectedinstance, orgname) |
|
|
// if(propValue === 'o') createChessInstance(selectedinstance, orgname) |
|
|
else process.exit() |
|
|
else process.exit() |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function createLocalChessInstance( cfg ){ |
|
|
function createLocalChessInstance( cfg ){ |
|
|
// return createInstance(cfg) |
|
|
// return createInstance(cfg) |
|
|
|
|
|
reconfirm = getReconfirmAll() |
|
|
var inst = {}; |
|
|
var inst = {}; |
|
|
var __new = Object.assign({}, /*__default,*/ cfg) |
|
|
|
|
|
|
|
|
var __new = Object.assign({}, __default, cfg) |
|
|
inst[cfg.node_env] = __new; return inst; |
|
|
inst[cfg.node_env] = __new; return inst; |
|
|
} |
|
|
} |
|
|
|
|
|
|