mirror of
https://github.com/Instadapp/trustwallet-assets.git
synced 2024-07-29 22:37:31 +00:00
Add FSXC (#2377)
* Add FSXC * Add new case and move file to ethereum folder Co-authored-by: Mykola <kolya182@gmail.com>
This commit is contained in:
parent
65d171baf9
commit
8b5f0a2413
Binary file not shown.
After Width: | Height: | Size: 49 KiB |
|
@ -19,6 +19,7 @@ import {
|
|||
readDirSync,
|
||||
rootDirAllowedFiles,
|
||||
toChecksum,
|
||||
isDirContainLogo
|
||||
} from "../src/test/helpers"
|
||||
|
||||
ethSidechains.forEach(chain => {
|
||||
|
@ -53,19 +54,29 @@ getRootDirFilesList().forEach(async file => {
|
|||
}
|
||||
});
|
||||
|
||||
// Moves blockchains/0xXX...XX.png => assets/blockchains/ethereum/0xXX...XX/logo.png
|
||||
readDirSync(chainsFolderPath).forEach(async chainFile => {
|
||||
const chainPath = getChainPath(chainFile)
|
||||
readDirSync(chainsFolderPath).forEach(async chainDir => {
|
||||
const chainPath = getChainPath(chainDir)
|
||||
const isDir = isPathDir(chainPath)
|
||||
const ethereumAssetsPath = getChainAssetsPath(Ethereum)
|
||||
|
||||
// Moves blockchains/0xXX...XX.png => assets/blockchains/ethereum/0xXX...XX/logo.png
|
||||
if (!isDir) {
|
||||
const checksum = toChecksum(getFileName(chainFile))
|
||||
const chainAssetsPath = getChainAssetsPath(Ethereum)
|
||||
|
||||
if (isChecksum(checksum) && getFileExt(chainFile).toLocaleLowerCase() === logoExtension) {
|
||||
await makeDirIfDoestExist(chainAssetsPath, checksum)
|
||||
const newPath = `${chainAssetsPath}/${checksum}/${logo}`
|
||||
const checksum = toChecksum(getFileName(chainDir))
|
||||
|
||||
if (isChecksum(checksum) && getFileExt(chainDir).toLocaleLowerCase() === logoExtension) {
|
||||
await makeDirIfDoestExist(ethereumAssetsPath, checksum)
|
||||
const newPath = `${ethereumAssetsPath}/${checksum}/${logo}`
|
||||
fs.renameSync(chainPath, newPath)
|
||||
}
|
||||
}
|
||||
|
||||
// Moves blockchains/0xXX...XX/logo.png => assets/blockchains/ethereum/0xXX...XX/logo.png
|
||||
if (isDir && isDirContainLogo(chainPath)) {
|
||||
const checksum = toChecksum(getFileName(chainDir))
|
||||
await makeDirIfDoestExist(ethereumAssetsPath, checksum)
|
||||
const newPath = `${ethereumAssetsPath}/${checksum}`
|
||||
fs.renameSync(chainPath, newPath)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
|
|
@ -92,6 +92,7 @@ export const getRootDirFilesList = (): string[] => readDirSync(root)
|
|||
export const readDirSync = (path: string): string[] => fs.readdirSync(path)
|
||||
export const makeDirSync = (path: string) => fs.mkdirSync(path)
|
||||
export const isPathExistsSync = (path: string): boolean => fs.existsSync(path)
|
||||
export const isDirContainLogo = (path: string): boolean => fs.existsSync(`${path}/${logo}`)
|
||||
export const isChainWhitelistExistSync = (chain: string): boolean => isPathExistsSync(getChainWhitelistPath(chain))
|
||||
export const isChainBlacklistExistSync = (chain: string): boolean => isPathExistsSync(getChainBlacklistPath(chain))
|
||||
export const isChainInfoExistSync = (chain: string): boolean => isPathExistsSync(getChainInfoPath(chain))
|
||||
|
|
Loading…
Reference in New Issue
Block a user