This commit is contained in:
Mykola 2020-05-17 18:20:58 -07:00
parent 6eeab95af1
commit 5dca22a3ba
8 changed files with 46 additions and 2 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 309 KiB

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 293 KiB

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 160 KiB

After

Width:  |  Height:  |  Size: 44 KiB

View File

@ -187,7 +187,7 @@
"description": "Bake'n'Rolls - one of the first Tezos bakery. Our mission is to deliver freshly baked pretzels on every cycle.",
"website": "https://bakenrolls.com/",
"payout": {
"commission": 9,
"commission": 5,
"payoutDelay": 6,
"payoutPeriod": 1
},
@ -350,7 +350,7 @@
},
"status": {
"disabled": true,
"note": "No more capacity: -13158"
"note": "No more capacity: -12883"
}
},
{

View File

@ -0,0 +1,26 @@
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}`);
}
})
}
})

View File

@ -61,6 +61,7 @@ export const maxLogoHeight = 512
export const maxAssetLogoSizeInKilobyte = 100
export const getChainAssetPath = (chain: string, address: string) => `${getChainAssetsPath(chain)}/${address}`
export const getAllChainsList = (): string[] => readDirSync(chainsFolderPath)
export const getChainAssetLogoPath = (chain: string, address: string) => `${getChainAssetsPath(chain)}/${address}/${logo}`
export const getChainAssetFilesList = (chain: string, address: string) => readDirSync(getChainAssetPath(chain, address))
export const getChainAssetsList = (chain: string): string[] => readDirSync(getChainAssetsPath(chain))
@ -139,6 +140,23 @@ export const isPathDir = (path: string): boolean => {
}
}
export const isPathDirEmpthy = (path: string): boolean => {
try {
if (isPathDir(path)) {
return fs.readdirSync(path).length == 0
} else {
false
}
} catch (error) {
console.log(`Error isPathDirEmpthy`, error)
process.exit(1)
}
}
export const removeDir = (path: string) => {
fs.rmdirSync(path, {recursive: true})
}
export const makeDirIfDoestExist = async (dirPath: string, dirName: string) => {
const path = `${dirPath}/${dirName}`
await fs.mkdir(path, {recursive: true}, (err) => {