UNPKG

renovate

Version:

Automated dependency updates. Flexible so you don't need to be.

34 lines (33 loc) 1.02 kB
import { newlineRegex } from "../../../util/regex.js"; import { GitTagsDatasource } from "../../datasource/git-tags/index.js"; //#region lib/modules/manager/mint/extract.ts function extractPackageFile(content) { const deps = []; for (const line of content.split(newlineRegex).map((s) => s.trim())) { if (line === "") continue; if (line.startsWith("#")) continue; if (line.includes("#")) { const [uncommentLine] = line.split("#"); deps.push(handleDepInMintfile(uncommentLine)); continue; } deps.push(handleDepInMintfile(line)); } return deps.length ? { deps } : null; } function handleDepInMintfile(line) { if (!line.includes("@")) return { depName: line, skipReason: "unspecified-version" }; const [depName, currentVersion] = line.split("@").map((s) => s.trim()); return { depName, currentValue: currentVersion, datasource: GitTagsDatasource.id, packageName: `https://github.com/${depName}.git` }; } //#endregion export { extractPackageFile }; //# sourceMappingURL=extract.js.map