Skip to content

Commit

Permalink
fix block formatting
Browse files Browse the repository at this point in the history
When editing with `eyaml edit`, the indentation would get inserted an
extra time on each line. Now blocks are formatted evenly.

Fixes #318.
  • Loading branch information
kenyon committed May 1, 2021
1 parent 78c73d7 commit 9c8d131
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/hiera/backend/eyaml/parser/encrypted_tokens.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def to_encrypted(args = {})
end
case format
when :block
@cipher = @cipher.gsub(/\s/, '')
chevron = args[:use_chevron].nil? || args[:use_chevron] ? ">\n" : ''
"#{label_string}#{chevron}" + @indentation + "ENC[#{@encryptor.tag},#{@cipher}]".scan(/.{1,60}/).join("\n" + @indentation)
when :string
Expand Down

0 comments on commit 9c8d131

Please sign in to comment.