From 6440f84c2dc586e2142c2fc755039be179849525 Mon Sep 17 00:00:00 2001 From: Daniel Pipkin Date: Wed, 4 Sep 2024 20:25:03 -0600 Subject: [PATCH] Error if program already printed --- virtual-programs/receipt-printer.folk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/virtual-programs/receipt-printer.folk b/virtual-programs/receipt-printer.folk index bcdfa7e5..d37a1fa0 100644 --- a/virtual-programs/receipt-printer.folk +++ b/virtual-programs/receipt-printer.folk @@ -1,5 +1,8 @@ namespace eval EscPos { proc printProgram {printer id code} { + if {[file exists "$::env(HOME)/folk-printed-programs/$id.folk"]} { + error "Program $id already exists on disk. Aborting print." + } writeFolkFile $id $code writeGeomFile $printer $id