create file if reading and not exist

Signed-off-by: AlienTornadosaurusHex <>
This commit is contained in:
AlienTornadosaurusHex 2023-06-22 20:39:28 +00:00
parent 2e96df3b7f
commit 2623117f17
2 changed files with 1 additions and 3 deletions

@ -7,7 +7,7 @@ import networkConfig from '../../networkConfig'
export function download({ name, directory }) {
const path = `${directory}${name}.gz`.toLowerCase()
const data = fs.readFileSync(path)
const data = fs.readFileSync(path, { flag: 'as+' })
const content = zlib.inflateSync(data)
return content

@ -112,8 +112,6 @@ async function start() {
const args = { ...parseArg(netId, tokenOrEvent), ...parseArg(netId, eventOrToken) }
console.log('ARGS => ', args, netId)
if (!enabledChains.includes(netId)) {
throw new Error(`Supported chain ids ${enabledChains.join(', ')}`)
}