Use relative path

stable
Miguel Gonzalez 2018-09-13 11:16:08 +02:00 committed by Alex Hermida
parent f19dabf7d6
commit f5a5f7b83c
1 changed files with 3 additions and 1 deletions

View File

@ -1,4 +1,5 @@
import os, sys
from pathlib import Path
LICENSE = """###
# Copyright (C) 2014-2018 Taiga Agile LLC
@ -40,9 +41,10 @@ def proccess_dirs(path):
data = fr.read()
if CONTAIN_TEXT not in data:
relative_path = Path(file_path).relative_to(path)
with open(file_path, "w") as fw:
fw.seek(0)
fw.write(LICENSE.format(file_name=file_name, data=data))
fw.write(LICENSE.format(file_name=relative_path, data=data))
for dir_path in DIRS: