mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-16 10:16:16 +01:00
17 lines
405 B
JavaScript
17 lines
405 B
JavaScript
|
|
const fs = require("fs");
|
||
|
|
const path = require("path");
|
||
|
|
|
||
|
|
function findMavenModuleRoot(directory) {
|
||
|
|
if (fs.existsSync(path.join(directory, "pom.xml"))) {
|
||
|
|
return directory;
|
||
|
|
}
|
||
|
|
return findMavenModuleRoot(path.resolve(directory, ".."));
|
||
|
|
}
|
||
|
|
|
||
|
|
function findTarget(directory) {
|
||
|
|
const moduleRoot = findMavenModuleRoot(directory);
|
||
|
|
return path.join(moduleRoot, "target");
|
||
|
|
}
|
||
|
|
|
||
|
|
module.exports = findTarget;
|