"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.updateArtifacts = void 0;
const tslib_1 = require("tslib");
const is_1 = tslib_1.__importDefault(require("@sindresorhus/is"));
const fs_1 = require("../../../util/fs");
const processors_1 = require("./processors");
async function updateArtifacts(updateArtifact) {
    const { packageFileName, newPackageFileContent } = updateArtifact;
    await (0, fs_1.writeLocalFile)(packageFileName, newPackageFileContent);
    // process specific tool sets
    const result = [];
    for (const processor of processors_1.processors) {
        const artifactUpdates = await processor.updateArtifacts(updateArtifact);
        if (is_1.default.array(artifactUpdates)) {
            result.push(...artifactUpdates);
        }
    }
    return result.length > 0 ? result : null;
}
exports.updateArtifacts = updateArtifacts;
//# sourceMappingURL=artifacts.js.map