Skip to content

Commit

Permalink
Fix potential missing ps1 signature in update_active
Browse files Browse the repository at this point in the history
  • Loading branch information
Ludwig CRON committed Dec 3, 2020
1 parent 4b7946d commit 4191fff
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion envs/bin/create
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ def update_active(env_dir: str = "./"):
)
elif ".ps1" in activate:
# find the signature if there is
idx = max(min([i for i, l in enumerate(lines) if "# SIG #" in l]), 0)
potential_sign = [i for i, l in enumerate(lines) if "# SIG #" in l]
idx = max(min(potential_sign), 0) if potential_sign else 0
fp.writelines(lines[: idx - 1])
fp.writelines(
[
Expand Down

0 comments on commit 4191fff

Please sign in to comment.