diff --git a/script/action/folders-and-files.ts b/script/action/folders-and-files.ts index 9f89da42d..28f7244b3 100644 --- a/script/action/folders-and-files.ts +++ b/script/action/folders-and-files.ts @@ -8,6 +8,8 @@ import { getChainLogoPath, getChainAssetsPath, getChainAssetPath, + getChainAssetLogoPath, + getChainAssetInfoPath, assetFolderAllowedFiles, getChainFolderFilesList, chainFolderAllowedFiles, @@ -71,6 +73,42 @@ export class FoldersFiles implements ActionInterface { return [errors, []]; } }, + { + getName: () => { return "Asset folders contain logo"}, + check: async () => { + var errors: string[] = []; + foundChains.forEach(chain => { + const assetsPath = getChainAssetsPath(chain); + if (isPathExistsSync(assetsPath)) { + readDirSync(assetsPath).forEach(address => { + const logoFullPath = getChainAssetLogoPath(chain, address); + if (!isPathExistsSync(logoFullPath)) { + errors.push(`Missing logo file for asset '${chain}/${address}' -- ${logoFullPath}`); + } + }) ; + } + }); + return [errors, []]; + } + }, + { + getName: () => { return "Asset folders contain info.json"}, + check: async () => { + var warnings: string[] = []; + foundChains.forEach(chain => { + const assetsPath = getChainAssetsPath(chain); + if (isPathExistsSync(assetsPath)) { + readDirSync(assetsPath).forEach(address => { + const infoFullPath = getChainAssetInfoPath(chain, address); + if (!isPathExistsSync(infoFullPath)) { + warnings.push(`Missing info file for asset '${chain}/${address}' -- ${infoFullPath}`); + } + }) ; + } + }); + return [[], warnings]; + } + }, { getName: () => { return "Asset folders contain only predefined set of files"}, check: async () => { @@ -79,7 +117,7 @@ export class FoldersFiles implements ActionInterface { const assetsPath = getChainAssetsPath(chain); if (isPathExistsSync(assetsPath)) { readDirSync(assetsPath).forEach(address => { - const assetFiles = getChainAssetPath(chain, address) + const assetFiles = getChainAssetPath(chain, address); readDirSync(assetFiles).forEach(assetFolderFile => { if (!(assetFolderAllowedFiles.indexOf(assetFolderFile) >= 0)) { errors.push(`File '${assetFolderFile}' not allowed at this path: ${assetsPath}`); @@ -90,7 +128,7 @@ export class FoldersFiles implements ActionInterface { }); return [errors, []]; } - }, + } ]; } diff --git a/script/action/update-all.ts b/script/action/update-all.ts index af337d80c..4142839fd 100644 --- a/script/action/update-all.ts +++ b/script/action/update-all.ts @@ -62,7 +62,7 @@ async function checkStepList(steps: CheckStepInterface[]): Promise<[string[], st console.log(` ${chalk.yellow('!')} '${warn}'`); warningsAll.push(warn); } else if (cnt == maxErrosFromOneCheck) { - console.log(` ${chalk.red('X')} ${warnings.length} warnings in total, omitting rest ...`); + console.log(` ${chalk.yellow('!')} ${warnings.length} warnings in total, omitting rest ...`); } cnt++; });