Skip to content

Commit

Permalink
Merge pull request #21 from natami/support_No_Transfer_Progress_Batch…
Browse files Browse the repository at this point in the history
…_Mode

Added support for noTransferProgress and batchMode MavenOptions.
  • Loading branch information
headcr4sh authored Jul 3, 2019
2 parents 670f917 + 3231a63 commit 526a0dd
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ Prevents Maven from building submodules if set to ```true```.
#### `threads` (default: ```undefined```)
Thread count, for instance 2.0C where C is core multiplied

#### `noTransferProgress` (default: ```false```)
Suppress the transfer progress when downloading/uploading in interactive mode if set to ```true```.

#### `batchMode` (default: ```false```)
Run in non-interactive (batch) mode (disables output color) if set to ```true```.

## Executing Maven commands

Executing Maven commands is simple, too:
Expand Down
11 changes: 11 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@ function _run(mvn, commands, defines) {
if (mvn.options.threads) {
args.push(`-T ${mvn.options.threads}`);
}
if (mvn.options.noTransferProgress) {
args.push('-ntp')
}
if (mvn.options.batchMode) {
args.push('-b')
}

if (defines) {
for (let define in defines) {
if (defines.hasOwnProperty(define)) {
Expand Down Expand Up @@ -145,6 +152,10 @@ function _run(mvn, commands, defines) {
* Prevents Maven from building submodules if set to <code>true</code>.
* @property {(number|undefined)} threads
* Thread count, for instance 2.0C where C is core multiplied
* @property {(boolean|undefined)} noTransferProgress
* Suppress the transfer progress when downloading/uploading in interactive mode if set to <code>true</code>
* @property {(boolean|undefined)} batchMode
* Run in non-interactive (batch) mode (disables output color) if set to <code>true</code>
*/


Expand Down
4 changes: 4 additions & 0 deletions typings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ export type MavenOptions = {
nonRecursive?: boolean,
/** Thread count, for instance 2.0C where C is core multiplied */
threads?: number
/** Suppress the transfer progress when downloading/uploading in interactive mode if set to <code>true</code> */
noTransferProgress?: boolean,
/** Run in non-interactive (batch) mode (disables output color) if set to <code>true</code> */
batchMode?: boolean
};

/**
Expand Down

0 comments on commit 526a0dd

Please sign in to comment.