Browse Source

app startup look for /lib relative to name of executable

master
Julian Noble 1 year ago
parent
commit
7ec552d600
  1. 10
      src/punk86.vfs/lib/app-punk/repl.tcl
  2. 5
      src/punk86.vfs/lib/app-shellspy/shellspy.tcl

10
src/punk86.vfs/lib/app-punk/repl.tcl

@ -34,7 +34,13 @@ if {[file exists $modulefolder]} {
if {[file exists [pwd]/modules]} {
catch {tcl::tm::add [pwd]/modules}
}
if {[file exists [pwd]/lib]} {
lappend ::auto_path [pwd]/lib
}
set libfolder [file dirname [file dirname [info nameofexecutable]]]/lib
if {[file exists $libfolder]} {
lappend ::auto_path $libfolder
}
#2)
#now add current dir (if no conflict with above)
@ -58,7 +64,7 @@ if {[llength $currentdir_modules]} {
}
#puts stdout "$::auto_path"
package require Thread
#These are strong dependencies
# - the repl requires Threading and punk,shellfilter,shellrun to call and display properly.

5
src/punk86.vfs/lib/app-shellspy/shellspy.tcl

@ -47,7 +47,10 @@ if {[string match "*.vfs/*" [info script]]} {
tcl::tm::add $m_dir
#set m_dir [file normalize [file join [file dirname [info script]] ../../../modules]]
#tcl::tm::add $m_dir
set libfolder [file dirname [file dirname [info nameofexecutable]]]/lib
if {[file exists $libfolder]} {
lappend ::auto_path $libfolder
}
#experiment - todo make a flag for it if it's useful
#Middle cap for direct dispatch without flagcheck arg processing or redirections or REPL.
set arg1 [lindex $::argv 0]

Loading…
Cancel
Save