瀏覽代碼

Added -v subcommand like git to operate on all folders

pull/5/head
chess 3 年之前
父節點
當前提交
4eed7782d4
共有 1 個文件被更改,包括 36 次插入2 次删除
  1. 36
    2
      index.js

+ 36
- 2
index.js 查看文件

@@ -542,6 +542,40 @@ var op = {
// git remote equivalents...
// git branch --set-upstream-to=elixir-unc/master master
// git push --set-upstream elixir-unc branch..
, 'remote': (args) => {
// Subcommands!
if(!processedArgs.v) return false;

var serial_perform = (repo) => {
var options = { cwd: instanceroot + '/' + repo }
return [
['git', ['remote', '-v'], options]
]
}

var x = (args) => {
var tasq = () => {
// console.log(args)
return nodeShellExec.apply(null, args).catch(e => {
// We continue on failure.
console.error(tasq.toString())
})
}
tasq.toString = function(){
return JSON.stringify(args)
}
return tasq;
}

var perform = (dir) => {
return any(serial_perform(dir.name).map(x))
}

dirs(perform)
}

, 'remote set-url': (args) => {
// git remote set-url elixir-unc //10.10.5.60/gitrepo/chess/bbhverse
var __args = {
@@ -589,7 +623,7 @@ var op = {
}
var perform_git_seturl = (dir) => {
op['is-git-repo'](dir).then((logEntry) => {
any(serial_perform_git_seturl(dir.name).map(x))
return any(serial_perform_git_seturl(dir.name).map(x))
}).catch((e) => {
// console.log('Failed : ' + dir.name)
})
@@ -1732,7 +1766,7 @@ function preworkerconfig(){
// The main elxr cli process
function elxrworker() {
var subcommandlabels = {
remote : `remote ${processedArgs._[1]}`
remote : (`remote ${processedArgs._[1] || ''}`).trim()
}

var __runcmd = function (label) {

Loading…
取消
儲存