简体   繁体   中英

How can I edit ansible-vault encrypted files in visual-studio-code?

I am using the command line tool ansible-vault and try to edit an encrypted file.

EDITOR=code ansible-vault edit test.txt

It is expected that code opens with the decrypted content in the editor. After saving ansible-vault should decrypt the (changed) buffer. Works much like editing a git commit message.

However, the buffer is empty. And changing/saving doesn't do much to the file.

I also tried it with vim and subl, which both worked as expected. What do I have to do to use visual-studio-code for the task?

Found it out. I need to:

EDITOR='code --wait' ansible-vault edit test.txt

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM