Update
Before Width: | Height: | Size: 102 KiB After Width: | Height: | Size: 94 KiB |
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 309 KiB After Width: | Height: | Size: 73 KiB |
Before Width: | Height: | Size: 293 KiB After Width: | Height: | Size: 80 KiB |
Before Width: | Height: | Size: 160 KiB After Width: | Height: | Size: 44 KiB |
|
@ -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.",
|
"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/",
|
"website": "https://bakenrolls.com/",
|
||||||
"payout": {
|
"payout": {
|
||||||
"commission": 9,
|
"commission": 5,
|
||||||
"payoutDelay": 6,
|
"payoutDelay": 6,
|
||||||
"payoutPeriod": 1
|
"payoutPeriod": 1
|
||||||
},
|
},
|
||||||
|
@ -350,7 +350,7 @@
|
||||||
},
|
},
|
||||||
"status": {
|
"status": {
|
||||||
"disabled": true,
|
"disabled": true,
|
||||||
"note": "No more capacity: -13158"
|
"note": "No more capacity: -12883"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
26
script/remove_empthy_folder.ts
Normal 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}`);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
|
@ -61,6 +61,7 @@ export const maxLogoHeight = 512
|
||||||
export const maxAssetLogoSizeInKilobyte = 100
|
export const maxAssetLogoSizeInKilobyte = 100
|
||||||
|
|
||||||
export const getChainAssetPath = (chain: string, address: string) => `${getChainAssetsPath(chain)}/${address}`
|
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 getChainAssetLogoPath = (chain: string, address: string) => `${getChainAssetsPath(chain)}/${address}/${logo}`
|
||||||
export const getChainAssetFilesList = (chain: string, address: string) => readDirSync(getChainAssetPath(chain, address))
|
export const getChainAssetFilesList = (chain: string, address: string) => readDirSync(getChainAssetPath(chain, address))
|
||||||
export const getChainAssetsList = (chain: string): string[] => readDirSync(getChainAssetsPath(chain))
|
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) => {
|
export const makeDirIfDoestExist = async (dirPath: string, dirName: string) => {
|
||||||
const path = `${dirPath}/${dirName}`
|
const path = `${dirPath}/${dirName}`
|
||||||
await fs.mkdir(path, {recursive: true}, (err) => {
|
await fs.mkdir(path, {recursive: true}, (err) => {
|
||||||
|
|