Use relative path
parent
f19dabf7d6
commit
f5a5f7b83c
|
@ -1,4 +1,5 @@
|
||||||
import os, sys
|
import os, sys
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
LICENSE = """###
|
LICENSE = """###
|
||||||
# Copyright (C) 2014-2018 Taiga Agile LLC
|
# Copyright (C) 2014-2018 Taiga Agile LLC
|
||||||
|
@ -40,9 +41,10 @@ def proccess_dirs(path):
|
||||||
data = fr.read()
|
data = fr.read()
|
||||||
|
|
||||||
if CONTAIN_TEXT not in data:
|
if CONTAIN_TEXT not in data:
|
||||||
|
relative_path = Path(file_path).relative_to(path)
|
||||||
with open(file_path, "w") as fw:
|
with open(file_path, "w") as fw:
|
||||||
fw.seek(0)
|
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:
|
for dir_path in DIRS:
|
||||||
|
|
Loading…
Reference in New Issue