Skip to content

Commit

Permalink
Merge pull request #495 from technophile-04/remove-reassignment-fileName
Browse files Browse the repository at this point in the history
remove redundant `name` variable
  • Loading branch information
wighawag authored Oct 29, 2023
2 parents c4e466c + 42dd844 commit e6cb832
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,11 @@ export function loadAllDeployments(
fs.readdirSync(deploymentsPath).forEach((fileName) => {
const fPath = path.resolve(deploymentsPath, fileName);
const stats = fs.statSync(fPath);
let name = fileName;
if (stats.isDirectory()) {
let chainIdFound: string;
const chainIdFilepath = path.join(fPath, '.chainId');
if (fs.existsSync(chainIdFilepath)) {
chainIdFound = fs.readFileSync(chainIdFilepath).toString().trim();
name = fileName;
} else {
throw new Error(
`with hardhat-deploy >= 0.6 you need to rename network folder without appended chainId
Expand All @@ -140,11 +138,11 @@ export function loadAllDeployments(
onlyABIAndAddress
);
const network = {
name,
name: fileName,
chainId: chainIdFound,
contracts,
};
networksFound[name] = network;
networksFound[fileName] = network;
all[chainIdFound].push(network);
}
});
Expand Down

0 comments on commit e6cb832

Please sign in to comment.