Skip to content

Commit f154974

Browse files
Take into account source folder being the repo root
1 parent 4d33639 commit f154974

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

main.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,11 @@ def sync_website_content(
9090
"""
9191
base_path = Path(os.getcwd())
9292
base_source_path = base_path / source_repo.split("/")[-1]
93-
source_path = base_source_path / source_folder
93+
if source_folder in ["/", ""]:
94+
source_path = base_source_path
95+
else:
96+
source_path = base_source_path / source_folder
97+
9498
base_translations_path = base_path / translations_repo.split("/")[-1]
9599
translations_path = base_translations_path / translations_folder
96100

@@ -149,8 +153,13 @@ def sync_website_content(
149153
else:
150154
dest = str(translations_path)
151155

156+
if source_folder in ["/", ""]:
157+
src = str(source_path) + "/"
158+
else:
159+
src = str(source_path)
160+
152161
run(["git", "checkout", "-b", branch_name], cwd=base_translations_path)
153-
run(["rsync", "-avr", "--delete", str(source_path), dest])
162+
run(["rsync", "-avr", "--delete", src, dest])
154163
run(["git", "status"], cwd=base_translations_path)
155164
run(["git", "add", "."], cwd=base_translations_path)
156165
_out, _err, rc = run(

0 commit comments

Comments
 (0)