Skip to content

Commit 5b1c017

Browse files
authored
feat: adds option for the path to report
#6
1 parent 048de82 commit 5b1c017

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ Options:
5959
multiple times. [array]
6060
--debug, -d Prints debugging information, such as commands executed
6161
and current status. [boolean] [Standard: false]
62+
--path-to-report, -p Points to the path where the report.json is saved
63+
standard is at the moment build/dependencyUpdates
6264
--no-color Disables color output
6365
```
6466

args.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ const argv = require("yargs")
2323
nargs: 1,
2424
demand: false,
2525
})
26+
.option("path-of-report", {
27+
alias: "p",
28+
describe: "Points to the path, where the report.json is defined",
29+
type: "array",
30+
nargs: 1,
31+
demand: false,
32+
})
2633
.option("debug", {
2734
alias: "d",
2835
describe: "Prints debugging information, such as commands executed and current status.",

index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ if (!gradleCommand) {
3232
}
3333

3434
const externalFiles = argv["external-file"];
35+
const pathOfReport = argv["path-of-report"];
36+
const outputDir = pathOfReport || "build/dependencyUpdates"
3537
const buildFiles = getBuildFiles(externalFiles, debugLog);
3638
debugLog(`Build Files:\n ${buildFiles.join("\n")}`);
3739
if (!buildFiles.length) {
@@ -83,7 +85,7 @@ ${"info".blue} Color legend :
8385

8486
// info Color legend :
8587

86-
const gradleDependencyUpdateArgs = ["dependencyUpdates", "-DoutputFormatter=json", "-DoutputDir=build/dependencyUpdates"];
88+
const gradleDependencyUpdateArgs = ["dependencyUpdates", "-DoutputFormatter=json", "-DoutputDir=${outputDir}"];
8789
const gradleDependencyUpdateResolution = argv.resolution;
8890
if (gradleDependencyUpdateResolution) {
8991
gradleDependencyUpdateArgs.push(`-Drevision=${gradleDependencyUpdateResolution}`);
@@ -286,7 +288,7 @@ function findOutdatedDependencies() {
286288
}
287289

288290
function findUpgradeJsonReportFiles() {
289-
const reportJsonPath = "build/dependencyUpdates/report.json";
291+
const reportJsonPath = "${outputDir}/report.json";
290292
const upgradeReportFiles = [];
291293
if (existsSync(reportJsonPath)) {
292294
upgradeReportFiles.push(reportJsonPath);

0 commit comments

Comments
 (0)