Skip to content

Commit

Permalink
feat(scripts): deleting dirs before copying packages in copyMovePacka…
Browse files Browse the repository at this point in the history
…ge. (#230)
  • Loading branch information
Foivos authored Dec 23, 2024
1 parent 2d6d8e6 commit 86f95ea
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/flat-mangos-work.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@axelar-network/axelar-cgp-sui': patch
---

Removing pre-existing dirs before copying a new one in copyMovePackage
4 changes: 4 additions & 0 deletions src/node/node-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ export function copyMovePackage(packageName: string, fromDir: null | string, toD
fromDir = `${__dirname}/../../move`;
}

if (fs.existsSync(`${toDir}/${packageName}`)) {
fs.rmSync(`${toDir}/${packageName}`, { recursive: true });
}

fs.cpSync(`${fromDir}/${packageName}`, `${toDir}/${packageName}`, { recursive: true });
}

Expand Down

0 comments on commit 86f95ea

Please sign in to comment.