Sha256: d967c318367073147efef4882ad9351bb428e3a6c29a41c6dee452d8caef2c2b
Contents?: true
Size: 978 Bytes
Versions: 15
Compression:
Stored size: 978 Bytes
Contents
# frozen_string_literal: true require "active_support/encrypted_file" module Jets module Command module Helpers module Editor private def ensure_editor_available(command:) if ENV["EDITOR"].to_s.empty? say "No $EDITOR to open file in. Assign one like this:" say "" say %(EDITOR="mate --wait" #{command}) say "" say "For editors that fork and exit immediately, it's important to pass a wait flag," say "otherwise the credentials will be saved immediately with no chance to edit." false else true end end def catch_editing_exceptions yield rescue Interrupt say "Aborted changing file: nothing saved." rescue ActiveSupport::EncryptedFile::MissingKeyError => error say error.message end end end end end
Version data entries
15 entries across 15 versions & 1 rubygems