-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
3,921 additions
and
3,680 deletions.
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
const fs = require("fs"); | ||
const { execSync } = require("child_process"); | ||
|
||
const currRoot = __dirname; | ||
|
||
if (fs.existsSync(`${currRoot}/node_modules/.yarn-integrity`)) { | ||
console.log( | ||
"Detected yarn-managed node_modules. Performing one-time cleanup..." | ||
); | ||
|
||
// Delete entire contents of all node_modules directories | ||
// But keep the directories themselves, in case they are volume mounts (e.g. in devcontainer) | ||
execSync( | ||
`find ${currRoot}/node_modules -mindepth 1 -maxdepth 1 -exec rm -rf {} +` | ||
); | ||
|
||
console.log("cleanup done"); | ||
} |
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
Oops, something went wrong.