Browse Source

arguments for remote add

master
AkshaThomas 3 years ago
parent
commit
f84c5af008
1 changed files with 20 additions and 9 deletions
  1. 20
    9
      index.js

+ 20
- 9
index.js View File



dirs(perform_git_seturl) dirs(perform_git_seturl)
} }
, 'add': (remotename, url, branch) => {
, 'remote add': (args) => {

// args === processedArgs ? args = {} : null;
var __args = {
remotename : args.remotename|| processedArgs._[2]
, url : args.url || processedArgs._[3]
, branch : args.branch || processedArgs._[4]
}
var remotename = __args.remotename
var url = __args.url
var branch = __args.branch

var pushable = processedArgs.pushable || false; var pushable = processedArgs.pushable || false;
remotename = remotename || processedArgs._[1]
url = url || processedArgs._[2]
branch = branch || processedArgs._[3]


var serial_perform_git_add = (repo) => { var serial_perform_git_add = (repo) => {
var options = { cwd: instanceroot + '/' + repo } var options = { cwd: instanceroot + '/' + repo }
// console.log(repo) // console.log(repo)
nodeShellExec('git', ['remote', 'get-url', remotename], { cwd: dir.name, stdio: 'ignore' }).then(() => { nodeShellExec('git', ['remote', 'get-url', remotename], { cwd: dir.name, stdio: 'ignore' }).then(() => {
console.log('skipped : ' + dir.name + ', reason : A remote with same name already exists.') console.log('skipped : ' + dir.name + ', reason : A remote with same name already exists.')
}) })
.catch((e) => {
any(serial_perform_git_add(dir.name).map(x))
})
.catch((e) => {
any(serial_perform_git_add(dir.name).map(x))
})
} }
// else console.log('Skipped : Not a Git Repo : ' + dir.name) // else console.log('Skipped : Not a Git Repo : ' + dir.name)
}).catch((e) => { }).catch((e) => {
// console.log('Failed : ' + dir.name)
console.log('Failed : ' + dir.name)
}) })
} }


const { readdir } = require("fs").promises const { readdir } = require("fs").promises
dirs(perform_git_add) dirs(perform_git_add)
} }
, 'remote remove': (args) => { , 'remote remove': (args) => {

Loading…
Cancel
Save