diff --git a/lib/arcanus/command/export.rb b/lib/arcanus/command/export.rb index 00ecaea..e30ebdb 100644 --- a/lib/arcanus/command/export.rb +++ b/lib/arcanus/command/export.rb @@ -9,9 +9,13 @@ class Export < Base 'consumption by other programs' def execute - ensure_key_unlocked + if ENV.key?('ARCANUS_PASSWORD') + key = Arcanus::Key.from_protected_file(repo.locked_key_path, ENV['ARCANUS_PASSWORD']) + else + ensure_key_unlocked + key = Arcanus::Key.from_file(repo.unlocked_key_path) + end - key = Arcanus::Key.from_file(repo.unlocked_key_path) chest = Arcanus::Chest.new(key: key, chest_file_path: repo.chest_file_path) env_vars = extract_env_vars(chest.to_hash)