Skip to content

Commit

Permalink
having ExpectedFilesRule run only on base dir
Browse files Browse the repository at this point in the history
  • Loading branch information
pellicceama committed Oct 26, 2022
1 parent 0be6c60 commit ce423c1
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions src/validate/rules/core/RepoStructureRules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,19 @@ export const RepoStructureRules: ValidationRule[] = [

const errors = [];
let valid = true;

directories.forEach(dir =>{

if(!fs.existsSync(path.join(repoPath, dir))){
errors.push({
source: `${repoPath}`,
message: `Directory ${dir} is missing`
});
valid = false;
}
})

if(repoPath.endsWith('/assets')) {
directories.forEach(dir =>{

if(!fs.existsSync(path.join(repoPath, dir))){
errors.push({
source: `${repoPath}`,
message: `Directory ${dir} is missing`
});
valid = false;
}
})
}

resolve({
valid: valid,
Expand Down

0 comments on commit ce423c1

Please sign in to comment.