mirror of
https://github.com/vofy/fekt-scara.git
synced 2025-05-06 14:01:00 +02:00
Add commit hash to generated files
This commit is contained in:
parent
0834add188
commit
e0452426fa
28 changed files with 5 additions and 1 deletions
3mf
arm
base
Base_Joint_Bottom_Left_[x1]_0834add.3mfBase_Joint_Bottom_Right_[x1]_0834add.3mfBase_Joint_Tip_Bottom_[x1]_0834add.3mfBase_Joint_Tip_Top_[x1]_0834add.3mfBase_Joint_Top_Left_[x1]_0834add.3mfBase_Joint_Top_Right_[x1]_0834add.3mfBase_Motor_Mount_[x1]_0834add.3mfBase_Panel_Blank_[x4]_0834add.3mfBase_Panel_Bottom_[x1]_0834add.3mfBase_Panel_Fan&Switch_[x1]_0834add.3mfBase_Panel_Fan_[x1]_0834add.3mfBase_Panel_Top_[x1]_0834add.3mfElectronics_Cover_Connectors_Module_[x1]_0834add.3mfElectronics_Cover_Display_Module_Hinge_Lock_[x1]_0834add.3mfElectronics_Cover_Display_Module_Hinge_[x1]_0834add.3mfElectronics_Cover_Display_Module_Panel_[x1]_0834add.3mfElectronics_DIN_Rail_Holder_[x6]_0834add.3mfElectronics_Display_Back_[x1]_0834add.3mfElectronics_Display_Frame_[x1]_0834add.3mfElectronics_Main_Board_Mount_[x1]_0834add.3mfElectronics_Main_Board_RPI_Mount_[1]_0834add.3mfElectronics_PSU_Mount_Bottom_[x1]_0834add.3mfElectronics_PSU_Mount_Top_[x1]_0834add.3mfFrame_Bearing_Holder_[x1]_0834add.3mfFrame_Handle_[x1]_0834add.3mfFrame_Plate_Clamp_[x4]_0834add.3mf
scripts
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,6 +1,7 @@
|
|||
#!/usr/bin/freecadcmd
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
import FreeCAD as App # type: ignore
|
||||
import Mesh # type: ignore
|
||||
|
||||
|
@ -13,6 +14,9 @@ project_root = os.path.abspath(
|
|||
printed_cad_dir = os.path.join(project_root, "cad", "printed")
|
||||
printed_3mf_dir = os.path.join(project_root, "3mf")
|
||||
|
||||
# Get the short hash of the current Git commit
|
||||
git_short_hash = subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD']).decode('ascii').strip()
|
||||
|
||||
# Create the 3mf directory if it doesn't exist
|
||||
os.makedirs(printed_3mf_dir, exist_ok=True)
|
||||
|
||||
|
@ -41,7 +45,7 @@ for root, dirs, files in os.walk(printed_cad_dir):
|
|||
output_path = os.path.join(
|
||||
printed_3mf_dir,
|
||||
os.path.relpath(root, printed_cad_dir),
|
||||
f"{obj.Label}.3mf",
|
||||
f"{obj.Label}_{git_short_hash}.3mf",
|
||||
)
|
||||
# Create the output directory if it doesn't already exist
|
||||
os.makedirs(os.path.dirname(output_path), exist_ok=True)
|
||||
|
|
Loading…
Reference in a new issue