mirror of
https://github.com/Instadapp/trustwallet-assets.git
synced 2024-07-29 22:37:31 +00:00
Add check for missing info files, only warning for now. (#5509)
Co-authored-by: Catenocrypt <catenocrypt@users.noreply.github.com>
This commit is contained in:
parent
159b7a2030
commit
38ed414425
|
@ -6,6 +6,7 @@ import { CheckStepInterface, ActionInterface } from "../generic/interface";
|
||||||
import {
|
import {
|
||||||
allChains,
|
allChains,
|
||||||
getChainLogoPath,
|
getChainLogoPath,
|
||||||
|
getChainAssetInfoPath,
|
||||||
getChainAssetsPath,
|
getChainAssetsPath,
|
||||||
getChainAssetPath,
|
getChainAssetPath,
|
||||||
getChainAssetLogoPath,
|
getChainAssetLogoPath,
|
||||||
|
@ -71,9 +72,10 @@ export class FoldersFiles implements ActionInterface {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
getName: () => { return "Asset folders contain logo"},
|
getName: () => { return "Asset folders contain logo and info"},
|
||||||
check: async () => {
|
check: async () => {
|
||||||
const errors: string[] = [];
|
const errors: string[] = [];
|
||||||
|
const warnings: string[] = [];
|
||||||
allChains.forEach(chain => {
|
allChains.forEach(chain => {
|
||||||
const assetsPath = getChainAssetsPath(chain);
|
const assetsPath = getChainAssetsPath(chain);
|
||||||
if (isPathExistsSync(assetsPath)) {
|
if (isPathExistsSync(assetsPath)) {
|
||||||
|
@ -82,10 +84,16 @@ export class FoldersFiles implements ActionInterface {
|
||||||
if (!isPathExistsSync(logoFullPath)) {
|
if (!isPathExistsSync(logoFullPath)) {
|
||||||
errors.push(`Missing logo file for asset '${chain}/${address}' -- ${logoFullPath}`);
|
errors.push(`Missing logo file for asset '${chain}/${address}' -- ${logoFullPath}`);
|
||||||
}
|
}
|
||||||
|
const infoFullPath = getChainAssetInfoPath(chain, address);
|
||||||
|
if (!isPathExistsSync(infoFullPath)) {
|
||||||
|
const msg = `Missing info file for asset '${chain}/${address}' -- ${infoFullPath}`;
|
||||||
|
//console.log(msg);
|
||||||
|
warnings.push(msg);
|
||||||
|
}
|
||||||
}) ;
|
}) ;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return [errors, []];
|
return [errors, warnings];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue
Block a user