renovate
Version:
Automated dependency updates. Flexible so you don't need to be.
23 lines (22 loc) • 1.08 kB
JavaScript
import { logger } from "../../../logger/index.js";
import { getSiblingFileName, readLocalFile, writeLocalFile } from "../../../util/fs/index.js";
import { updateBazelLockfile } from "./lockfile.js";
//#region lib/modules/manager/bazel-module/artifacts.ts
async function updateArtifacts({ packageFileName, updatedDeps, newPackageFileContent, config }) {
logger.debug(`bazel-module.updateArtifacts(${packageFileName})`);
const { isLockFileMaintenance } = config;
if (!updatedDeps.length && !isLockFileMaintenance) {
logger.debug("No updated bazel-module deps - returning null");
return null;
}
const lockFileName = getSiblingFileName(packageFileName, "MODULE.bazel.lock");
if (!await readLocalFile(lockFileName, "utf8")) {
logger.debug("No MODULE.bazel.lock found - skipping artifact update");
return null;
}
await writeLocalFile(packageFileName, newPackageFileContent);
return await updateBazelLockfile(lockFileName, packageFileName, isLockFileMaintenance, config.constraints?.bazelisk);
}
//#endregion
export { updateArtifacts };
//# sourceMappingURL=artifacts.js.map