Commit 6ae4910d authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

BF: Adjustments to commonBase function

parent c63487f8
......@@ -485,14 +485,17 @@ def commonBase(paths):
depths = [len(p.split(op.sep)) for p in paths]
base = max(zip(depths, paths), key=operator.itemgetter(0))[1]
last = base
while True:
base = op.split(base)[0]
if len(base) == 0:
if base == last or len(base) == 0:
last = base
if all([p.startswith(base) for p in paths]):
return base
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment