Skip to content

Commit

Permalink
New friendly message to help debug when replace_in errors out (#524)
Browse files Browse the repository at this point in the history
  • Loading branch information
taquitos authored Jun 15, 2021
1 parent 06eb441 commit 63e06bf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,9 @@ def attach_changelog_to_master(version_number)
end

def replace_in(previous_text, new_text, path)
if new_text.to_s.strip.empty?
fail "Missing `new_text` in call to `replace_in`, looking for replacement for #{previous_text} 😵."
end
sed_regex = 's|' + previous_text + '|' + new_text + '|'
backup_extension = '.bck'
sh("sed", '-i', backup_extension, sed_regex, path)
Expand Down

0 comments on commit 63e06bf

Please sign in to comment.