From a81e913f84ecedf970178b9c3c3164ae1fbb5012 Mon Sep 17 00:00:00 2001 From: Amadeo Pellicce Date: Wed, 26 Oct 2022 11:42:01 +0200 Subject: [PATCH] fixing issue that was leading to false negatives on the validate function --- src/validate/rules/core/RepoStructureRules.ts | 3 --- src/validate/rules/network/NetworkDirectoryRules.ts | 6 +++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/validate/rules/core/RepoStructureRules.ts b/src/validate/rules/core/RepoStructureRules.ts index 2089f85..c3765b9 100644 --- a/src/validate/rules/core/RepoStructureRules.ts +++ b/src/validate/rules/core/RepoStructureRules.ts @@ -17,9 +17,6 @@ export const RepoStructureRules: ValidationRule[] = [ return new Promise((resolve, reject) => { - if(!repoPath.endsWith('/assets')) { - return resolve({ valid: true, errors: [] }) - } const errors = []; let valid = true; diff --git a/src/validate/rules/network/NetworkDirectoryRules.ts b/src/validate/rules/network/NetworkDirectoryRules.ts index c251073..d82db1c 100644 --- a/src/validate/rules/network/NetworkDirectoryRules.ts +++ b/src/validate/rules/network/NetworkDirectoryRules.ts @@ -11,7 +11,7 @@ const networkFiles = [ export const NetworkDirectoryRules: ValidationRule[] = [ { - name: `${baseName}:FileNamesRule`, + name: `${baseName}:NetworkDirectoryRules`, network: 'all', validate: async (network: string, repoPath: string): Promise => { @@ -28,8 +28,8 @@ export const NetworkDirectoryRules: ValidationRule[] = [ if(!fs.existsSync(path.join(repoPath, 'info.json'))){ console.log('Error: info.json not found on ' + path.join(repoPath, 'info.json')); errors.push({ - source: `${repoPath}`, - message: `${network} info.json is missing` + source: `${baseName}:${path.join(repoPath, 'info.json')}`, + message: `${network} network info.json is missing` }); valid = false; }