@constructor-io/constructorio-connect-cli
Version:
CLI tool to enable users to interface with the Constructor Connect Ecosystem
22 lines (21 loc) • 613 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.fileExists = fileExists;
const fs_extra_1 = require("fs-extra");
const path_1 = require("../customer/path");
/**
* Returns true if the file exists, false otherwise
* @param filepath The path of the file you want to check
* @returns boolean
*/
function fileExists(filepath, isCustomerPath = false) {
const fullPath = isCustomerPath
? filepath
: (0, path_1.getCustomerOSSpecificPath)(filepath);
try {
return (0, fs_extra_1.existsSync)(fullPath);
}
catch {
return false;
}
}