Skip to content

Commit

Permalink
nvbn#1188: Remove only leading whitespace chars from script
Browse files Browse the repository at this point in the history
  • Loading branch information
scorphus committed Jul 23, 2021
1 parent 58ddd43 commit b146574
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion tests/test_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ def test_from_script_calls(self, Popen, settings, os_environ):
([''], None),
(['', ''], None),
(['ls', '-la'], 'ls -la'),
(['ls'], 'ls')])
(['ls'], 'ls'),
(['echo \ '], 'echo \ '),
(['echo \\\n'], 'echo \\\n')])
def test_from_script(self, script, result):
if result:
assert Command.from_raw_script(script).script == result
Expand Down
2 changes: 1 addition & 1 deletion thefuck/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,4 +344,4 @@ def format_raw_script(raw_script):
else:
script = ' '.join(raw_script)

return script.strip()
return script.lstrip()

0 comments on commit b146574

Please sign in to comment.