-
-
Save cdcharlebois/948fd0833a3163f9aa5cf3a1db236ae1 to your computer and use it in GitHub Desktop.
remove excess files from javascriptsource
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
find ./<mendix_project>/javascriptsource/<module_name>/node_modules -type f \ | |
-not -name "*.js" \ | |
-and -not -name "*.json" \ | |
-and -not -name "*.ts" \ | |
-and -not -name "*.jsx" \ | |
-and -not -name "*.tsx" \ | |
-and -not -name "*.js_commonjs-exports" \ | |
-and -not -name "*.js.commonjs-module" \ | |
| xargs rm -r |
can confirm that this works for windows (powershell):
Get-ChildItem .\node_modules -Recurse | Where{$_.Name -notmatch "(.js|.ts|.tsx|.jsx|.json|.js_commonjs-exports|.js_commonjs-module)$" -and !$_.PSIsContainer} | Remove-Item
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A windows equivalent might go something like this: https://stackoverflow.com/questions/23767489/how-can-one-delete-files-in-a-folder-matching-a-regular-expression-using-powersh