vscode-ansible-vault icon indicating copy to clipboard operation
vscode-ansible-vault copied to clipboard

Windows: decoding fail when entering password

Open efim-a-efim opened this issue 6 years ago • 2 comments

I use VSCode on Windows. When trying to use this extension without storing password on filesystem (e.g. entering password each time it's required), I face the following error:

Command failed: touch C:\Users\User\AppData\Local\Temp\tmp-57692Jab9WhG31WYX && echo "PassWord" > C:\Users\User\AppData\Local\Temp\tmp-57692Jab9WhG31WYX 'touch' is not recognized as an internal or external command, operable program or batch file.

It's an expected behavior, because Windows doesn't have Unix commands natively.

My offer is to use TypeScript/JS native ways to write files (e.g. fs module) - this will resolve all possible cross-platform problems.

efim-a-efim avatar Jul 17 '18 10:07 efim-a-efim

Also after looking at the code, I see that there's some kind of "path magic" like:

let keyfile = config.keyfile.trim("/");
keyfile = keyfile.trim("/");

It's not cross-platform, on Windows path separator is \, not /. It should be OK to remove this code and print an error when someone puts incorrect path there.

efim-a-efim avatar Jul 17 '18 10:07 efim-a-efim

I'm having the same issue here. It would be nice to be able to use this on Windows.

tvories avatar Sep 11 '18 17:09 tvories