sparkyb / ansible-vault-win

Stand-alone Ansible Vault CLI that works on Windows
MIT License
8 stars 1 forks source link

Set default editor to notepad #1

Closed thmshmm closed 3 years ago

thmshmm commented 3 years ago

Hi Ben, this is great.

I updated the default editor used for Windows. Just if anyone to come across this.

The editor could also be set by running $Env:EDITOR = "notepad.exe" in PowerShell.

I also had an error installing the package. It complained that Rust is required. Update pip to overcome this issue.

Kr

sparkyb commented 3 years ago

I, myself, like a POSIX-like environment so I use git bash which is why I set the default editor to nano, but I think you raise a good point that notepad is a better default on Windows. I can always override it in my .bashrc. That said, I'm trying to not make this Windows exclusive, even though I included -win in the package name and assume anyone on an actual POSIX platform would just install the official Ansible. So I think I'd prefer to do a platform test and only default to notepad if platform.system() == 'Windows'.

Your PR reminded me that I forgot to push a couple additional commits. If you take a look at these new commits, you'll notice 2 things. One is a few cases where I do a similar platform check. The other is that one of the two new features, supporting password file scripts, assume using a POSIX like shell (bash) on Windows (it expects /bin/sh to exist to run the password script, uses /usr/bin/test to determine if a password file is executable, and uses /usr/bin/cygpath to convert the script path from a Windows to POSIX path). I couldn't think of a Windows native way of doing this. However, should your environment not contain these things, it will just gracefully not support password file scripts and assume any password file is a plain password file.

I'm not sure what's up it saying it required Rust. That's likely either an issue with some part of your setup unrelated to this package, or it could it could be related to the cryptography sub-dependency that I have no control of. Glad you were able to easily resolve it.

thmshmm commented 3 years ago

Checking for the platform is definitely a good idea. I can't test it on git-bash. It just hangs. Maybe my installation is broken.

Yes, it was the cryptography dependency.