summaryrefslogtreecommitdiff
path: root/hid/patch.py
blob: 24ba212391ac05aea65cafb2be501eb86635fa86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from os.path import join
from os.path import exists

Import("env")


# =====
env_path = join(env["PROJECTLIBDEPS_DIR"], env["PIOENV"])
flag_path = join(env_path, ".patched")

if not exists(flag_path):
    env.Execute(f"patch -p1 -d {join(env_path, 'HID-Project_ID523')} < {join('patches', 'absmouse.patch')}")

    def touch_flag(*_, **__) -> None:
        with open(flag_path, "w") as flag_file:
            pass

    env.Execute(touch_flag)