forked from egguy/grott-home-assistant-add-on
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dodo.py
44 lines (37 loc) · 1.33 KB
/
dodo.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# use pydoit to run the pipeline
# url: http://pydoit.org/
# install pydoit: pip install doit (or pipx)
import os
import glob
BUILDS = [
"grott",
"grott-current",
]
TRANSLATIONS_FOLDER = "translations"
def task_copy_translations():
"""Copy translations from the source to the translations folder."""
translations = glob.glob(f"{TRANSLATIONS_FOLDER}/*.yaml")
for build in BUILDS:
for translation in translations:
# get the file basename
translation = os.path.basename(translation)
yield {
"name": f"copy {translation} to {build}",
"actions": [
f"mkdir -p {build}/translations",
f"cp {TRANSLATIONS_FOLDER}/{translation} {build}/translations/{translation}",
],
"file_dep": [f"{TRANSLATIONS_FOLDER}/{translation}"],
"targets": [f"{build}/translations/{translation}"],
}
def task_copy_requirements():
"""Copy requirements.txt to the builds."""
for build in BUILDS:
yield {
"name": f"copy requirements.txt to {build}",
"actions": [
f"cp requirements.txt {build}/requirements.txt",
],
"file_dep": ["requirements.txt"],
"targets": [f"{build}/requirements.txt"],
}