@iotize/cli
Version:
IoTize command line interface
17 lines • 564 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const clime_1 = require("clime");
const fs_1 = require("fs");
const path_1 = require("path");
class FileExists {
validate(value, context) {
if (!value) {
throw new clime_1.ExpectedError(`File path is required`);
}
if (!fs_1.existsSync(path_1.resolve(value))) {
throw new clime_1.ExpectedError(`File does not exist: "${value}"`);
}
}
}
exports.FileExists = FileExists;
//# sourceMappingURL=file-exists.js.map