-
Notifications
You must be signed in to change notification settings - Fork 33.5k
Fix use platform specific datapath #16712 #170364
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
base: main
Are you sure you want to change the base?
Fix use platform specific datapath #16712 #170364
Conversation
@microsoft-github-policy-service agree |
Co-authored-by: Kashif Ahmed <33416799+ProKashif@users.noreply.github.com>
if (fs.existsSync(newFilePath)) { // already exists | ||
fs.unlinkSync(oldFilePath); | ||
} else { // move the old file to a new location | ||
fs.renameSync(oldFilePath, newFilePath); |
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.
if fs.renameSync
failed for some reason, should we display an error + exit cleanly instead of crashing?
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.
+1 might be permission issue
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.
lgtm aside from the one comment about fs.renameSync
error handling
Is this relevant? I mean is this the only available fix for #162712? |
Fixes #162712