From 9f441164e7e5995150441fca96ace414b71986c2 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sat, 6 Jun 2026 16:14:04 -0500 Subject: [PATCH] fix: fix string escape sequences, per warnings --- rattail_fabric2/nodejs.py | 4 ++-- rattail_fabric2/util.py | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/rattail_fabric2/nodejs.py b/rattail_fabric2/nodejs.py index c35999c..7300311 100644 --- a/rattail_fabric2/nodejs.py +++ b/rattail_fabric2/nodejs.py @@ -50,8 +50,8 @@ def install(c, version=None, user=None): c.sudo(f'touch {profile}') c.sudo(f'chown {user}: {profile}') append(c, profile, 'export NVM_DIR="{}"'.format(nvm), **kwargs) - append(c, profile, '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"', **kwargs) - append(c, profile, '[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"', **kwargs) + append(c, profile, '[ -s "$NVM_DIR/nvm.sh" ] && \\. "$NVM_DIR/nvm.sh"', **kwargs) + append(c, profile, '[ -s "$NVM_DIR/bash_completion" ] && \\. "$NVM_DIR/bash_completion"', **kwargs) node = version or 'node' cmd = "bash -l -c 'nvm install {}'".format(node) diff --git a/rattail_fabric2/util.py b/rattail_fabric2/util.py index 50381cf..e74d168 100644 --- a/rattail_fabric2/util.py +++ b/rattail_fabric2/util.py @@ -154,8 +154,8 @@ def is_win(c): """ Return True if remote SSH server is running Windows, False otherwise. - The idea is based on echoing quoted text: \*NIX systems will echo quoted - text only, while Windows echoes quotation marks as well. + The idea is based on echoing quoted text: \\*NIX systems will echo + quoted text only, while Windows echoes quotation marks as well. .. note:: @@ -170,7 +170,7 @@ def _expand_path(c, path): Return a path expansion E.g. ~/some/path -> /home/myuser/some/path - /user/\*/share -> /user/local/share + /user/\\*/share -> /user/local/share More examples can be found here: http://linuxcommand.org/lc3_lts0080.php .. versionchanged:: 1.0 @@ -207,10 +207,10 @@ def sed(c, filename, before, after, limit='', use_sudo=False, backup='.bak', ``. Setting ``backup`` to an empty string will, disable backup file creation. - For convenience, ``before`` and ``after`` will automatically escape forward - slashes, single quotes and parentheses for you, so you don't need to - specify e.g. ``http:\/\/foo\.com``, instead just using ``http://foo\.com`` - is fine. + For convenience, ``before`` and ``after`` will automatically + escape forward slashes, single quotes and parentheses for you, so + you don't need to specify e.g. ``http:\\/\\/foo\\.com``, instead + just using ``http://foo\\.com`` is fine. If ``use_sudo`` is True, will use `sudo` instead of `run`.