Skip to content

Commit

Permalink
fix:split files in update-metadata script
Browse files Browse the repository at this point in the history
  • Loading branch information
0xa3k5 committed Apr 14, 2024
1 parent 8eb69ac commit 527db0e
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions packages/utils/src/scripts/update-metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,21 +144,24 @@ const processSVGFile = async (
}
}

const files = process.argv.slice(2)

const main = async (filePaths: string[]) => {
for (const filePath of filePaths) {
const type = filePath.includes('/tokens/') ? 'token' : 'network'
await processSVGFile(filePath, type)
const main = async () => {

const files = process.argv.slice(2)

if (files === undefined || files.length === 0) {
console.log('No SVG files provided')
return
}

files[0]?.split(',').forEach(async (filePath) => {
const type = filePath.includes('/tokens/') ? 'token' : 'network'
processSVGFile(filePath, type)
})
}

try {
main(files)
console.log(
'Metadata updated successfully for',
files.map((f) => f).join('\n '),
)
main()
} catch (error) {
console.error('Failed to update metadata:', error)
process.exit(1)
Expand Down

0 comments on commit 527db0e

Please sign in to comment.