Skip to content

Commit

Permalink
Prepare env file before running hardhat scripts
Browse files Browse the repository at this point in the history
Before running the hardhat scripts the prepare script will ensure the
`.env` file is available, if not it will be created from the example.
  • Loading branch information
nkuba committed Apr 25, 2024
1 parent 5d99732 commit e81a5d2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions solidity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
],
"scripts": {
"clean": "hardhat clean && rm -rf cache/ export/ gen/ export.json",
"build": "hardhat compile",
"deploy": "hardhat deploy --export export.json",
"docs": "hardhat docgen",
"prepare:env": "cp -n .env.example .env || true",
"build": "npm run prepare:env && hardhat compile",
"deploy": "npm run prepare:env && hardhat deploy --export export.json",
"docs": "npm run prepare:env && hardhat docgen",
"format": "npm run lint:js && npm run lint:sol && npm run lint:config",
"format:fix": "npm run lint:js:fix && npm run lint:sol:fix && npm run lint:config:fix",
"lint:js": "eslint .",
Expand All @@ -27,7 +28,7 @@
"lint:config": "prettier --check '**/*.@(json)'",
"lint:config:fix": "prettier --write '**/*.@(json)'",
"node:forking": "FORKING=true hardhat node --no-deploy",
"test": "hardhat test ./test/*.test.ts",
"test": "npm run prepare:env && hardhat test ./test/*.test.ts",
"test:integration": "hardhat test --deploy-fixture ./test/integration/*.test.ts --network integration"
},
"devDependencies": {
Expand Down

0 comments on commit e81a5d2

Please sign in to comment.