averify that the path is not a folder

This commit is contained in:
tdurieux
2021-04-27 09:18:07 +02:00
parent dc84de9d84
commit bed2671a73

View File

@@ -337,6 +337,9 @@ module.exports.isFilePathValid = async (options) => {
);
if (ofs.existsSync(anonymizedFilePath)) {
if (fs.lstatSync(anonymizedFilePath).isDirectory()) {
throw "is_folder";
}
return true;
}
@@ -367,6 +370,9 @@ module.exports.isFilePathValid = async (options) => {
);
if (ofs.existsSync(originalFilePath)) {
if (fs.lstatSync(originalFilePath).isDirectory()) {
throw "is_folder";
}
if (!module.exports.isFileSupported(repoConfig, originalFilePath)) {
throw "file_not_supported";
}