Fork of the espurna firmware for `mhsw` switches
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

22 lines
641 B

import os
import shutil
def copy_release(target, source, env):
# target filename and subdir for release files
name = env["ESPURNA_NAME"]
version = env["ESPURNA_VERSION"]
if not name or not version:
raise ValueError("Cannot set up release without release variables present")
destdir = os.path.join(env.subst("$PROJECT_DIR"), "..", "firmware", version)
if not os.path.exists(destdir):
os.makedirs(destdir)
dest = os.path.join(
destdir, "espurna-{version}-{name}.bin".format(version=version, name=name)
)
src = env.subst("$BUILD_DIR/${PROGNAME}.bin")
shutil.copy(src, dest)