"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.localChartHasKustomizationsYaml = exports.kustomizationsKeysUsed = void 0;
const tslib_1 = require("tslib");
const upath_1 = tslib_1.__importDefault(require("upath"));
const fs_1 = require("../../../util/fs");
/** Returns true if a helmfile release contains kustomize specific keys **/
function kustomizationsKeysUsed(release) {
    return (release.strategicMergePatches !== undefined ||
        release.jsonPatches !== undefined ||
        release.transformers !== undefined);
}
exports.kustomizationsKeysUsed = kustomizationsKeysUsed;
/** Returns true if a helmfile release uses a local chart with a kustomization.yaml file **/
// eslint-disable-next-line require-await
async function localChartHasKustomizationsYaml(release, helmFileYamlFileName) {
    const helmfileYamlParentDir = (0, fs_1.getParentDir)(helmFileYamlFileName) || '';
    return (0, fs_1.localPathExists)(upath_1.default.join(helmfileYamlParentDir, release.chart, 'kustomization.yaml'));
}
exports.localChartHasKustomizationsYaml = localChartHasKustomizationsYaml;
//# sourceMappingURL=utils.js.map