-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: replace rm -rf with node -e for cross-platform file deletion #501
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is because the yarn cache does not need to be tracked in version control.
What is there for the project to gain by not checking-in the dependencies, in concrete and measurable terms?
Regarding rimraf, I'm personally not a fan of adding a third-party dependency just to remove a folder. If we needed cross compatibility we could just call node -e
.
Ignoring the
I understand your concern about adding a third-party dependency like 'rimraf'. While using |
Co-authored-by: Antoine du Hamel <[email protected]>
"corepack": "ts-node ./sources/_cli.ts", | ||
"lint": "eslint .", | ||
"prepack": "yarn build", | ||
"postpack": "rm -rf dist shims", | ||
"postpack": "run clean", | ||
"rimraf": "node -e 'for(let i=2;i<process.argv.length;i++)fs.rmSync(process.argv[i],{recursive:true,force:true});'", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"rimraf": "node -e 'for(let i=2;i<process.argv.length;i++)fs.rmSync(process.argv[i],{recursive:true,force:true});'", | |
"rimraf": "node -e 'for(let arg of process.argv.slice(2))fs.rmSync(arg,{recursive:true,force:true})'", |
slightly shorter
This PR includes two main updates:
The
.gitignore
file has been updated to ignore the yarn cache directory. This is because the yarn cache does not need to be tracked in version control.The usage of 'rm -rf' has been replaced with 'rimraf' in the package scripts. This change ensures cross-platform compatibility.
These changes contribute to better project maintenance and cross-platform compatibility.