Skip to content

Commit

Permalink
Merge branch '__rultor'
Browse files Browse the repository at this point in the history
  • Loading branch information
rultor committed Jun 6, 2024
2 parents ef02f0e + 3bda3b3 commit eba5e9f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/mvnw.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ module.exports.flags = function(opts) {
console.debug('Target in %s', rel(target));
return [
'-Deo.version=' + opts.parser,
'-Deo.tag=' + (opts.tag ? opts.tag : opts.parser),
'-Deo.tag=' + (opts.homeTag ? opts.homeTag : opts.parser),
opts.verbose ? '--errors' : '',
opts.verbose ? '' : '--quiet',
opts.debug ? '--debug' : '',
Expand Down
16 changes: 15 additions & 1 deletion test/test_mvnw.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,26 @@
* SOFTWARE.
*/

const {mvnw} = require('../src/mvnw');
const {mvnw, flags} = require('../src/mvnw');
const assert = require('assert');

describe('mvnw', function() {
it('prints Maven own version', function(done) {
const opts = {batch: true};
mvnw(['--version', '--quiet'], null, opts.batch);
done();
});
it('sets right flags from options', function(done) {
const opts = {
sources: 'sources',
target: 'target',
parser: 'parser',
homeTag: 'homeTag'
};
mvnw(['--version', '--quiet', ...flags(opts)]).then((args) => {
assert.ok(args.includes('-Deo.tag=homeTag'));
assert.ok(args.includes('-Deo.version=parser'));
done();
});
});
});

0 comments on commit eba5e9f

Please sign in to comment.