encrypted_secrets_ex icon indicating copy to clipboard operation
encrypted_secrets_ex copied to clipboard

Detect presence of an editor

Open azuby opened this issue 5 years ago • 0 comments

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

azuby avatar Aug 14 '19 01:08 azuby