diff --git a/lib/command_add.js b/lib/command_add.js new file mode 100644 index 0000000..89e9791 --- /dev/null +++ b/lib/command_add.js @@ -0,0 +1,26 @@ +'use strict'; + +module.exports = function (task, exec, done) { + var options = task.options({ + directory: null, + files: null + }); + + var args = ['add']; + + if (options.directory) { + args.push('-C ' + options.directory); + } + + if (options.files && options.files.length === 1 && options.files[0] === '*') { + args.push('.'); + } + //else{} //TO DO: add individual files + + // Add callback + args.push(done); + + exec.apply(this, args); +}; + +module.exports.description = 'Add files to a repository'; \ No newline at end of file diff --git a/lib/command_init.js b/lib/command_init.js new file mode 100644 index 0000000..5776679 --- /dev/null +++ b/lib/command_init.js @@ -0,0 +1,39 @@ +'use strict'; + +var ArgUtil = require('flopmang'); + +module.exports = function (task, exec, done) { + var argUtil = new ArgUtil(task, [ + { //