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

  1. import os
  2. import shutil
  3. def copy_release(target, source, env):
  4. # target filename and subdir for release files
  5. name = env["ESPURNA_NAME"]
  6. version = env["ESPURNA_VERSION"]
  7. if not name or not version:
  8. raise ValueError("Cannot set up release without release variables present")
  9. destdir = os.path.join(env.subst("$PROJECT_DIR"), "..", "firmware", version)
  10. if not os.path.exists(destdir):
  11. os.makedirs(destdir)
  12. dest = os.path.join(
  13. destdir, "espurna-{version}-{name}.bin".format(version=version, name=name)
  14. )
  15. src = env.subst("$BUILD_DIR/${PROGNAME}.bin")
  16. shutil.copy(src, dest)