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
640 B

import os
import shutil
def copy_release(target, source, env):
# target filename and subdir for release files
name = env["ESPURNA_RELEASE_NAME"]
version = env["ESPURNA_RELEASE_VERSION"]
destdir = env["ESPURNA_RELEASE_DESTINATION"]
if not name or not version or not destdir:
raise ValueError("Cannot set up release without release variables present")
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)