mirror of
https://github.com/awalsh128/cache-apt-pkgs-action.git
synced 2026-07-07 17:44:36 +00:00
17 lines
534 B
JavaScript
17 lines
534 B
JavaScript
import fs from "node:fs";
|
|
export function writeManifest(filePath, entries) {
|
|
const normalized = [...entries].filter(Boolean).sort((a, b) => a.localeCompare(b));
|
|
fs.writeFileSync(filePath, normalized.join("\n"), "utf8");
|
|
}
|
|
export function readManifestAsCsv(filePath) {
|
|
if (!fs.existsSync(filePath)) {
|
|
return "";
|
|
}
|
|
return fs
|
|
.readFileSync(filePath, "utf8")
|
|
.split(/\r?\n/)
|
|
.map((line) => line.trim())
|
|
.filter(Boolean)
|
|
.join(",");
|
|
}
|
|
//# sourceMappingURL=manifest.js.map
|