Method: Invar::Rake::Task::SecretsFileHandler#edit
- Defined in:
- lib/invar/rake/task/secrets.rb
#edit ⇒ Object
Updates the file with new content.
Either the content is provided over STDIN or the default editor is opened with the decrypted contents of the secrets file. After closing the editor, the file will be updated with the new encrypted contents.
34 35 36 37 38 39 40 |
# File 'lib/invar/rake/task/secrets.rb', line 34 def edit content = $stdin.stat.pipe? ? $stdin.read : nil edit_encrypted_file(secrets_file, content: content) warn "File saved to #{ secrets_file }" end |