Skip to content

Commit 4c2f1d5

Browse files
committed
Simplify platformio script, use env.GetProjectOption() instead of parsing platformio.ini separately.
1 parent 8c1e237 commit 4c2f1d5

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

airrohr-firmware/platformio_script.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
Import("env")
2-
import configparser
32
import hashlib
43
import os
54
import shutil
6-
from base64 import b64decode
7-
8-
config = configparser.ConfigParser()
9-
config.read("platformio.ini")
105

116
def _file_md5_hexdigest(fname):
127
return hashlib.md5(open(fname, 'rb').read()).hexdigest()
@@ -15,9 +10,7 @@ def after_build(source, target, env):
1510
if not os.path.exists("builds"):
1611
os.mkdir("builds")
1712

18-
configName = b64decode(ARGUMENTS.get("PIOENV"))
19-
sectionName = 'env:' + configName.decode('utf-8')
20-
lang = config.get(sectionName, "lang")
13+
lang = env.GetProjectOption('lang')
2114
target_name = lang.lower()
2215

2316
with open(f"builds/latest_{target_name}.bin.md5", "w") as md5:

0 commit comments

Comments
 (0)