20 lines
455 B
Python
20 lines
455 B
Python
import configparser
|
|
import sys
|
|
Import('env')
|
|
|
|
config = configparser.ConfigParser()
|
|
config.read("platformio.ini")
|
|
|
|
sign_cert = config.get('uploadconfig', 'sign_cert')
|
|
|
|
cert = ''
|
|
|
|
try:
|
|
with open(sign_cert, 'r') as f:
|
|
for line in f:
|
|
cert += line.replace("\n", " ")
|
|
env.Append(BUILD_FLAGS='\'-DPUBLIC_SIGN_KEY="' + cert + '"\'')
|
|
except FileNotFoundError:
|
|
sys.stderr.write("No public key for signing found! Continuing without update support!\n")
|
|
pass
|