create file if reading and not exist
Signed-off-by: AlienTornadosaurusHex <>
This commit is contained in:
parent
2e96df3b7f
commit
2623117f17
@ -7,7 +7,7 @@ import networkConfig from '../../networkConfig'
|
|||||||
export function download({ name, directory }) {
|
export function download({ name, directory }) {
|
||||||
const path = `${directory}${name}.gz`.toLowerCase()
|
const path = `${directory}${name}.gz`.toLowerCase()
|
||||||
|
|
||||||
const data = fs.readFileSync(path)
|
const data = fs.readFileSync(path, { flag: 'as+' })
|
||||||
const content = zlib.inflateSync(data)
|
const content = zlib.inflateSync(data)
|
||||||
|
|
||||||
return content
|
return content
|
||||||
|
@ -112,8 +112,6 @@ async function start() {
|
|||||||
|
|
||||||
const args = { ...parseArg(netId, tokenOrEvent), ...parseArg(netId, eventOrToken) }
|
const args = { ...parseArg(netId, tokenOrEvent), ...parseArg(netId, eventOrToken) }
|
||||||
|
|
||||||
console.log('ARGS => ', args, netId)
|
|
||||||
|
|
||||||
if (!enabledChains.includes(netId)) {
|
if (!enabledChains.includes(netId)) {
|
||||||
throw new Error(`Supported chain ids ${enabledChains.join(', ')}`)
|
throw new Error(`Supported chain ids ${enabledChains.join(', ')}`)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user