Plugin utilities.
Retrieves all possible path prefixes of a path, in descending order of length. For instance:
(Linux) /a/b/c returns ['/a/b/c', '/a/b', '/a', '/'] (Windows) C:abc returns ['C:abc', 'C:ab', 'C:a', 'C:']
(Linux) /a/b/c returns ['/a/b/c', '/a/b', '/a', '/']
/a/b/c
['/a/b/c', '/a/b', '/a', '/']
(Windows) C:abc returns ['C:abc', 'C:ab', 'C:a', 'C:']
C:abc
['C:abc', 'C:ab', 'C:a', 'C:']
path (str) – the path to break into prefixes
all possible path prefixes of given path in descending order
list of str
list
str
Attempt to perform PATH surgery to find cmd
Mitigates https://github.com/certbot/certbot/issues/1833
cmd (str) – the command that is being searched for in the PATH
True if the operation succeeded, False otherwise