man/90-rearrange-path: apply "ruff format" and "ruff check --fix"
This commit is contained in:
@@ -17,6 +17,7 @@ interesting generators.
|
||||
import os
|
||||
import pathlib
|
||||
|
||||
|
||||
def rearrange_bin_sbin(path):
|
||||
"""Make sure any pair of …/bin, …/sbin directories is in this order
|
||||
|
||||
@@ -33,9 +34,10 @@ def rearrange_bin_sbin(path):
|
||||
items[i], items[j] = items[j], items[i]
|
||||
return ':'.join(p.as_posix() for p in items)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
path = os.environ['PATH'] # This should be always set.
|
||||
# If it is not, we will just crash, which is OK too.
|
||||
# This should be always set. If it is not, we will just crash, which is OK too.
|
||||
path = os.environ['PATH']
|
||||
new = rearrange_bin_sbin(path)
|
||||
if new != path:
|
||||
print('PATH={}'.format(new))
|
||||
print(f'PATH={new}')
|
||||
|
||||
Reference in New Issue
Block a user