Skip to content

Commit

Permalink
build: clean up old artifacts (#487)
Browse files Browse the repository at this point in the history
  • Loading branch information
spsjvc authored Jun 14, 2024
1 parent dd6ac28 commit 4a6fafc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"gen:network": "ts-node ./scripts/genNetwork.ts",
"prepublishOnly": "yarn build && yarn format",
"preversion": "yarn lint",
"prebuild": "yarn gen:abi",
"build": "./scripts/builder",
"watch": "tsc --watch",
"test": "mocha",
Expand Down
7 changes: 6 additions & 1 deletion scripts/genAbi.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
const { runTypeChain, glob } = require('typechain')
const { execSync } = require('child_process')
const { unlinkSync } = require('fs')
const { unlinkSync, existsSync, rmSync } = require('fs')

const getPackagePath = packageName => {
const path = require.resolve(`${packageName}/package.json`)
return path.substr(0, path.indexOf('package.json'))
}

async function main() {
if (existsSync('./src/lib/abi/')) {
console.log('Removing previously generated ABIs.\n')
rmSync('./src/lib/abi/', { recursive: true })
}

const cwd = process.cwd()

const nitroPath = getPackagePath('@arbitrum/nitro-contracts')
Expand Down

0 comments on commit 4a6fafc

Please sign in to comment.