@catladder/cli
Version:
Panter cli tool for cloud CI/CD and DevOps
19 lines (18 loc) • 437 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.readFileOrError = void 0;
const fs_extra_1 = require("fs-extra");
const readFile = file => (0, fs_extra_1.readFile)(file, {
encoding: "utf-8"
});
const readFileOrError = async filePath => {
try {
const file = await readFile(filePath);
return [null, file];
} catch (e) {
return [e];
}
};
exports.readFileOrError = readFileOrError;