Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Detect presence of an editor #5

Open
azuby opened this issue Aug 14, 2019 · 0 comments
Open

Detect presence of an editor #5

azuby opened this issue Aug 14, 2019 · 0 comments

Comments

@azuby
Copy link

azuby commented Aug 14, 2019

First off, great work on putting together your first package and thank you for putting it together!

It would be great to have a simple check to ensure you have an editor available from the CLI, and instructions on how to do so if one isn't present. The error is somewhat convoluted if you attempt to open the secrets without an editor:

$ EDITOR='code --wait' mix EncryptedSecrets.Edit
** (ErlangError) Erlang error: :enoent
    (elixir) lib/system.ex:791: System.cmd("code", ["--wait", "priv/secrets/secrets_tmp_83FECEA52E179DB3.yml"], [])
    lib/encrypted_secrets.ex:63: EncryptedSecrets.edit/2
    lib/mix/tasks/encrypted_secrets/edit.ex:12: Mix.Tasks.EncryptedSecrets.Edit.run/1
    (mix) lib/mix/task.ex:331: Mix.Task.run_task/3
    (mix) lib/mix/cli.ex:79: Mix.CLI.run_task/2

Setting up and editor is as simple as running the following on MacOS:
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/sublime

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant