mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-22 09:50:37 +00:00
common.tools: Add a function for relative pathes
rel_path(a, b) is the absolute path of b, taken relative to a. If b is already an absolute path, rel_path(a, b) is b.
This commit is contained in:
parent
81778136bc
commit
734afd892b
1 changed files with 5 additions and 0 deletions
|
@ -133,3 +133,8 @@ def copy_tree(from_path, to_path):
|
|||
for path in files:
|
||||
copy(os.path.join(abs_prefix, path),
|
||||
os.path.join(to_path, prefix, path))
|
||||
|
||||
|
||||
def rel_path(base, path):
|
||||
import os.path
|
||||
return os.path.join(os.path.dirname(base), path)
|
||||
|
|
Loading…
Add table
Reference in a new issue