~roadmr/canonical-identity-provider/webauthn-register-endpoint-part-2-the-registration

« back to all changes in this revision

Viewing changes to scripts/build_vanilla.py

Merged webauthn-register-endpoint into webauthn-register-endpoint-part-2-the-registration.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import io
 
2
import os
 
3
 
 
4
import sass
 
5
 
 
6
# Up one level from scripts directory
 
7
project_dir = os.path.dirname(
 
8
    os.path.dirname(os.path.abspath(__file__))
 
9
)
 
10
app_path = "src/identityprovider/"
 
11
 
 
12
compiled = sass.compile(
 
13
    filename=os.path.join(
 
14
        project_dir, app_path, "static_src/scss/styles.scss"
 
15
    ),
 
16
    output_style="compressed",
 
17
    include_paths=[
 
18
        os.path.join(project_dir, "node_modules"),
 
19
        os.path.join(
 
20
            project_dir, app_path, "static_src/scss"
 
21
        ),
 
22
    ],
 
23
    source_comments=False,
 
24
    source_map_filename=os.path.join(
 
25
        project_dir,
 
26
        app_path,
 
27
        "static/vanilla-css/styles.map.css",
 
28
    ),
 
29
)
 
30
 
 
31
with io.open(
 
32
    os.path.join(
 
33
        project_dir,
 
34
        app_path,
 
35
        "static/vanilla-css/styles.css",
 
36
    ),
 
37
    "w",
 
38
    encoding="utf-8",
 
39
) as f:
 
40
    f.write(compiled[0])
 
41
 
 
42
with io.open(
 
43
    os.path.join(
 
44
        project_dir,
 
45
        app_path,
 
46
        "static/vanilla-css/styles.map.css",
 
47
    ),
 
48
    "w",
 
49
    encoding="utf-8",
 
50
) as f:
 
51
    f.write(compiled[1])