main.tcl at [3dc3a41cee]

File build/kits/app/main.tcl artifact cd67a0db55 part of check-in 3dc3a41cee


#! /usr/bin/env tclsh

package require starkit
starkit::startup

apply {{} {
	set topdir $::starkit::topdir

	switch -glob -- [info nameofexecutable] {
		"*-rpc-client" - "rpc-client" - "rpc-client.*" {
			set mode "rpc-client"
		}
		default {
			set mode "node"

			# XXX: Override the built-in log file location
			set ::logfd [open node.log a+]
		}
	}

	package require nano
	set nanoVersion [package present nano]

	set nanoDir [file join $topdir lib tcl-nano${nanoVersion}]

	tailcall source [file join $nanoDir bin $mode]
}}