Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions lib/command_add.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@ module.exports = function (task, exec, done) {
var options = argUtil.options;
var args = ['add'].concat(argUtil.getArgFlags());

task.files.forEach(function (files) {
for (var i = 0; i < files.src.length; i++) {
args.push(files.src[i]);
}
task.data.files.src.forEach(function (file) {
args.push(file);
});

args.push(done);
Expand Down
6 changes: 2 additions & 4 deletions lib/command_clean.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,8 @@ module.exports = function (task, exec, done) {
var args = ['clean'].concat(argUtil.getArgFlags());

// Add the file paths to the arguments.
task.files.forEach(function (files) {
for (var i = 0; i < files.src.length; i++) {
args.push(files.src[i]);
}
task.data.files.src.forEach(function (file) {
args.push(file);
});

// Add callback
Expand Down
6 changes: 2 additions & 4 deletions lib/command_commit.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,8 @@ module.exports = function (task, exec, done) {
var options = argUtil.options;
var args = ['commit'].concat(argUtil.getArgFlags());

task.files.forEach(function (files) {
for (var i = 0; i < files.src.length; i++) {
args.push(files.src[i]);
}
task.data.files.src.forEach(function (file) {
args.push(file);
});

args.push(done);
Expand Down
10 changes: 3 additions & 7 deletions lib/command_reset.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,9 @@ module.exports = function (task, exec, done) {
var options = argUtil.options;
var args = ['reset'].concat(argUtil.getArgFlags());

if (!options.mode) {
task.files.forEach(function (files) {
for (var i = 0; i < files.src.length; i++) {
args.push(files.src[i]);
}
});
}
task.data.files.src.forEach(function (file) {
args.push(file);
});

// Add callback
args.push(done);
Expand Down
8 changes: 4 additions & 4 deletions test/_common.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ var Task = (function () {
return _.defaults(this.test.options, defaults);
};

Object.defineProperty(Task.prototype, 'files', {
Object.defineProperty(Task.prototype, 'data', {
get: function () {
return [
{
return {
files: {
src: this.test.files
}
];
};
}
});

Expand Down
4 changes: 2 additions & 2 deletions test/add_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ describe('add', function () {
};

var files = [
'test.txt'
'test.txt', 'b.txt'
];

new Test(command, options, files)
.expect(['add', '--force', 'test.txt'])
.expect(['add', '--force', 'test.txt', 'b.txt'])
.run(done);
});

Expand Down