@atlassian/wrm-troubleshooting
Version:
A tool that can help you with troubleshooting the configuration of webpack and Atlassian P2 project.
30 lines • 1.16 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.locatePomFile = void 0;
const path_1 = __importDefault(require("path"));
const pom_1 = require("../pom");
const types_1 = require("./types");
const locatePomFile = async (options) => {
let pomFile = options.pom ? path_1.default.resolve(options.pom) : await (0, pom_1.findRootPomXmlFile)();
const rootPomFileFound = options.pom ? false : Boolean(pomFile);
// Skip asking for pom file if we have a root file
if (!options.yes || !pomFile) {
if (pomFile) {
pomFile = await (0, pom_1.confirmRootPomFile)(pomFile, rootPomFileFound);
}
if (!pomFile) {
pomFile = await (0, pom_1.askForPomXmlFile)(rootPomFileFound);
}
}
if (pomFile instanceof Error) {
return (0, types_1.getFailedResult)(pomFile);
}
return (0, types_1.getPassedResult)({
pomFile,
});
};
exports.locatePomFile = locatePomFile;
//# sourceMappingURL=locatePomFile.js.map