mickeypearce / vscode-oracle-format

PL/SQL formatter (using SQLcl)
https://marketplace.visualstudio.com/items?itemName=mp.vscode-oracle-format
11 stars 4 forks source link

Fix the issue with space in filename for Linux and Mac #9

Closed rafael-trevisan closed 5 years ago

rafael-trevisan commented 5 years ago

That should fix the https://github.com/mickeypearce/vscode-oracle-format/issues/5 which I also have the issue :)

mickeypearce commented 5 years ago

Hey @rafael-trevisan , thanks a lot for PR. :1st_place_medal:

Unfortunatelly It doesn't work on WIN with escaped double quotes:

SQL> format file 
\"c:\user\myfile.sql\" not exists

Maybe we should switch with process.platform , what do you think?

rafael-trevisan commented 5 years ago

Hi @mickeypearce, using process.platform makes total sense.

This is how I usually do in my projects:

const file = os.platform() === 'win32' ? path.normalize('./path/windows/file') : path.normalize('./path/non-windows/file');

That usually takes care of the slashes, quotes, spaces and whatever.

Let me know if you need a MacOS user to test :)