Skip to content
Browse files

Fixed problem with missing -r flag (extended regexp) in Mac OS X sed …

…version.
  • Loading branch information...
1 parent ee81f0e commit 04ffb74c386d83f56c984de0ad349893f60a968d @konradhalas konradhalas committed
Showing with 2 additions and 1 deletion.
  1. +2 −1 fabric/contrib/files.py
View
3 fabric/contrib/files.py
@@ -189,7 +189,8 @@ def sed(filename, before, after, limit='', use_sudo=False, backup='.bak',
&& cp -p %(filename)s %(filename)s%(backup)s \
&& mv %(tmp)s %(filename)s"""
else:
- expr = r"sed -i%(backup)s -r -e %(script)s %(filename)s"
+ context['extended_regex'] = '-E' if platform == 'Darwin' else '-r'
+ expr = r"sed -i%(backup)s %(extended_regex)s -e %(script)s %(filename)s"
command = expr % context
return func(command, shell=shell)

0 comments on commit 04ffb74

Please sign in to comment.
Something went wrong with that request. Please try again.