mirror of https://github.com/zulip/zulip.git
ruff: Fix FURB129 iterate over file object directly.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
5af8dfda3e
commit
7b69c93c50
|
@ -98,7 +98,7 @@ def setup_shell_profile(shell_profile: str) -> None:
|
||||||
def write_command(command: str) -> None:
|
def write_command(command: str) -> None:
|
||||||
if os.path.exists(shell_profile_path):
|
if os.path.exists(shell_profile_path):
|
||||||
with open(shell_profile_path) as shell_profile_file:
|
with open(shell_profile_path) as shell_profile_file:
|
||||||
lines = [line.strip() for line in shell_profile_file.readlines()]
|
lines = [line.strip() for line in shell_profile_file]
|
||||||
if command not in lines:
|
if command not in lines:
|
||||||
with open(shell_profile_path, "a+") as shell_profile_file:
|
with open(shell_profile_path, "a+") as shell_profile_file:
|
||||||
shell_profile_file.writelines(command + "\n")
|
shell_profile_file.writelines(command + "\n")
|
||||||
|
|
Loading…
Reference in New Issue