From bf769adac699a4a628187b2209ce75033cd8ac83 Mon Sep 17 00:00:00 2001 From: Julian Noble Date: Sun, 6 Aug 2023 05:30:30 +1000 Subject: [PATCH] fix auto_execs for tclkit so able to call self as sub process --- src/punk86.vfs/main.tcl | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/punk86.vfs/main.tcl b/src/punk86.vfs/main.tcl index e2b1b543..bf00b925 100644 --- a/src/punk86.vfs/main.tcl +++ b/src/punk86.vfs/main.tcl @@ -1,10 +1,19 @@ - package require starkit - starkit::startup - if {[llength $::argv]} { +package require starkit +starkit::startup + +#when run as a tclkit - the exe is mounted as a dir and Tcl's auto_execok doesn't find it +set thisexe [file tail [info nameofexecutable]] +set thisexeroot [file rootname $thisexe] +set ::auto_execs($thisexeroot) [info nameofexecutable] +if {$thisexe ne $thisexeroot} { + set ::auto_execs($thisexe) [info nameofexecutable] +} + +if {[llength $::argv]} { package require app-shellspy - } else { +} else { package require app-punk repl::start stdin - } +}