We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fabric.contrib.files.upload_template relies on brace expansion to create the backup file - eg.
fabric.contrib.files.upload_template
cp "$(echo report.txt)"{,.bak}
This fails if env.shell does not support brace expansion (which is true for /bin/sh).
env.shell
The following patch fixes the issue.
diff --git a/fabric/contrib/files.py b/fabric/contrib/files.py index 5db5b31..ef2515f 100644 --- a/fabric/contrib/files.py +++ b/fabric/contrib/files.py @@ -150,7 +150,9 @@ def upload_template(filename, destination, context=None, use # Back up original file if backup and exists(destination): - func("cp %s{,.bak}" % _expand_path(destination)) + orig = _expand_path(destination) + bak = _expand_path(destination + ".bak") + func("cp %s %s" % (orig,bak)) # Upload the file. return put(
The text was updated successfully, but these errors were encountered:
Remove advanced shell expansion syntax from upload_template
15f7f63
Closes #1227
contrib: upload_template: more compatible shell syntax
35ee4f3
fixes fabric/fabric#1227
81edabc
Closes fabric#1227
Successfully merging a pull request may close this issue.
fabric.contrib.files.upload_template
relies on brace expansion to create the backup file - eg.cp "$(echo report.txt)"{,.bak}
This fails if
env.shell
does not support brace expansion (which is true for /bin/sh).The following patch fixes the issue.
The text was updated successfully, but these errors were encountered: