-
Notifications
You must be signed in to change notification settings - Fork 322
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix
MODULE_NOT_FOUND
error due to missing dev.json
- Loading branch information
1 parent
b9a16d0
commit 0a442ee
Showing
3 changed files
with
18 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
/live | ||
/accounts.json | ||
/dist/deployments/dev.json | ||
/temp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import fs from "fs"; | ||
import path from "path"; | ||
|
||
const deploymentsDir = "deployments"; | ||
const devDeploymentName = "dev.json"; | ||
|
||
const exists = (file: string) => fs.existsSync(file) && fs.lstatSync(file).isFile(); | ||
|
||
const devDeployments = () => | ||
fs | ||
.readdirSync(deploymentsDir, { withFileTypes: true }) | ||
.filter(dirent => dirent.isDirectory() && dirent.name !== "backfill") | ||
.map(deploymentDir => path.join(deploymentsDir, deploymentDir.name, devDeploymentName)) | ||
.concat(path.join(deploymentsDir, devDeploymentName)) | ||
.filter(exists); | ||
|
||
devDeployments().forEach(devDeployment => fs.unlinkSync(devDeployment)); |