gistpad
gistpad copied to clipboard
Unable to open Gist file with backslash in the filename
Environment: Windows 10 VSCode 1.42.1 GistPad 0.0.55
Error Message:
Unable to open 'bat.json': Unable to read file 'gist://2ee56db181266c4cb39c4f482e1277e6/snippets\bat.json' (TypeError: Cannot read property 'truncated' of undefined).
Steps to Reproduce:
1. Create a text file with some content either locally or directly in the Gist.
2. Refresh GistPad so that the file resides in both locations.
3. Check that you can view the file.
Try steps 4.x or 5.x
4.1 Rename the file locally by adding a backslash to the file name.
4.2 Refresh GistPad.
4.4 Check that the file was updated in the Gist
4.5. Try to view or rename the file locally.
OR
5.1 Rename the file in the Gist by adding a backslash to the file name.
5.2 Refresh GistPad.
5.2 Check that the file was updated locally and is visible in the tree.
5.3. Try to view or rename the file locally.
I ran across this today when trying to view a file from a Gist that stores configuration files. The Gist files are named by prefacing their filename with their path, and on a Windows system that includes a backslash.
If I go into the Gist and change or remove the backslash character it works. If I rename a local file from a Gist by adding a backslash it does rename the file and push it back into the Gist but after that all other attempts to read or rename the file again to remove the backslash fail.
Thanks for reporting this! I’ll take a look at this issue first thing tomorrow 👍
I stumbled on this problem when working on #109, I may be able to add the fix when I'll file that PR