Skip to content

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

da-viper
Copy link

@da-viper da-viper commented Jan 1, 2023

Fixes #162712

@da-viper
Copy link
Author

da-viper commented Jan 1, 2023

@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);

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?

Copy link

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

Copy link

@alichtman alichtman left a 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

@ZerdoX-x
Copy link

ZerdoX-x commented May 5, 2024

Is this relevant?

I mean is this the only available fix for #162712?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support XDG_CONFIG_HOME for the argv.json file
6 participants