Merge "Using the --non-interactive flag now force-overwrites files."
This commit is contained in:
@@ -19,6 +19,9 @@
|
|||||||
|
|
||||||
// Add support for a `--non-interactive` flag
|
// Add support for a `--non-interactive` flag
|
||||||
this.option('non-interactive');
|
this.option('non-interactive');
|
||||||
|
|
||||||
|
// If non-interactive is set, force-override all files.
|
||||||
|
this.conflicter.force = this.options['non-interactive'];
|
||||||
},
|
},
|
||||||
|
|
||||||
initializing: function () {
|
initializing: function () {
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
helpers.run(generator)
|
helpers.run(generator)
|
||||||
|
.withArguments(['--non-interactive'])
|
||||||
.on('end', function () {
|
.on('end', function () {
|
||||||
spies.forEach(function (spy) {
|
spies.forEach(function (spy) {
|
||||||
expect(spy.calls.any()).toBeTruthy();
|
expect(spy.calls.any()).toBeTruthy();
|
||||||
@@ -34,6 +35,18 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should force overwrite if --non-interactive is set.',
|
||||||
|
function (done) {
|
||||||
|
helpers.run(generator)
|
||||||
|
.withArguments(['--non-interactive'])
|
||||||
|
.on('ready', function (generator) {
|
||||||
|
expect(generator.conflicter.force).toBeTruthy();
|
||||||
|
})
|
||||||
|
.on('end', function () {
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe('writing()', function () {
|
describe('writing()', function () {
|
||||||
it('should create all files created in the project builder',
|
it('should create all files created in the project builder',
|
||||||
function (done) {
|
function (done) {
|
||||||
|
|||||||
Reference in New Issue
Block a user