🔨 Simpler distinct firmware rename (#25957)
This commit is contained in:
@@ -60,6 +60,7 @@ if pioutil.is_pio_build():
|
||||
|
||||
def rename_target(source, target, env):
|
||||
from pathlib import Path
|
||||
Path(target[0].path).replace(Path(target[0].dir.path, new_name))
|
||||
from datetime import datetime
|
||||
Path(target[0].path).replace(Path(target[0].dir.path, datetime.now().strftime(new_name.replace('{date}', '%Y%m%d').replace('{time}', '%H%M%S'))))
|
||||
|
||||
marlin.add_post_action(rename_target)
|
||||
|
@@ -1,9 +0,0 @@
|
||||
#
|
||||
# random-bin.py
|
||||
# Set a unique firmware name based on current date and time
|
||||
#
|
||||
import pioutil
|
||||
if pioutil.is_pio_build():
|
||||
from datetime import datetime
|
||||
Import("env")
|
||||
env['PROGNAME'] = datetime.now().strftime("firmware-%Y%m%d-%H%M%S")
|
Reference in New Issue
Block a user