Skip to content

Path /tmp/vscode-diff.patch does not work on Windows (includes solution) #1

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
ADTC opened this issue Aug 15, 2021 · 0 comments
Open

Comments

@ADTC
Copy link

ADTC commented Aug 15, 2021

There's no /tmp on Windows, so it won't work. The extension will always give an error.

To fix this:

  • Either detect the environment and use "C:\Windows\Temp" on Windows systems.
  • Or: simply use the Git repository root path and create the file as ${path}/.git/huytd-vscode.diff

Update line 25 to:

        const temp = `${path}/.git/huytd-vscode.diff`;

Notes:

  • Any file created in the .git directory will be ignored by Git. So there's no danger of this diff file being committed.
  • There's also no need to detect the environment in this case. It will work on all environments.
  • The use of diff extension is more correct than using patch extension and better supported by other tools.

Tip: For those seeking to manually modify the extension, you can do so in this file %USERPROFILE%\.vscode\extensions\huytd.vscode-diff-0.0.1\out\extension.js and then execute Developer: Reload Window command in VS Code.

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

No branches or pull requests

1 participant