mirror of
https://github.com/Instadapp/trustwallet-assets.git
synced 2024-07-29 22:37:31 +00:00
27 lines
753 B
TypeScript
27 lines
753 B
TypeScript
import {
|
|
getChainAssetPath,
|
|
getChainAssetsPath,
|
|
isPathDir,
|
|
isPathDirEmpthy,
|
|
readDirSync,
|
|
removeDir,
|
|
getAllChainsList,
|
|
} from "../src/test/helpers"
|
|
|
|
getAllChainsList().forEach(async chain => {
|
|
const chainAssetsPath = getChainAssetsPath(chain)
|
|
|
|
if (isPathDir(chainAssetsPath)) {
|
|
readDirSync(chainAssetsPath).forEach(async (asset) => {
|
|
const assetPath = getChainAssetPath(chain, asset);
|
|
const isDir = await isPathDir(assetPath);
|
|
const isPathEmpthy = await isPathDirEmpthy(assetPath);
|
|
|
|
if (isDir && isPathEmpthy) {
|
|
removeDir(assetPath)
|
|
console.log(`Removed empty folder at path ${assetPath}`);
|
|
}
|
|
})
|
|
}
|
|
})
|