kieraneglin / kieraneglin/encrypted_secrets_ex

Detect presence of an editor

Open
#5 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Elixir
Stars
50
Forks
6
PR merge metrics
No merged PRs in 30d

Description

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`

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with lib/encrypted_secrets.ex and lib/mix/tasks/encrypted_secrets/edit.ex, then reproduce the shown mix EncryptedSecrets.Edit command with an unavailable editor. The work is done when the CLI detects that no editor is available and gives instructions for configuring one instead of exposing the convoluted :enoent error.

Written by the indexing model from the issue text.

Assessment

Tech stack
elixir
Domain
cli
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.