X-Git-Url: https://git.sven.stormbind.net/?a=blobdiff_plain;f=checkAutoPath.tcl;fp=checkAutoPath.tcl;h=71d41a6b06b8725bf9dd602564448def6ace74b4;hb=b0e6fb6e4379fb87fa2854b84a56c5ad49c644da;hp=0000000000000000000000000000000000000000;hpb=c9a5bcd9d76f699909b24e71a2a216d36062ab0b;p=sven%2Ftclcurl.git diff --git a/checkAutoPath.tcl b/checkAutoPath.tcl new file mode 100755 index 0000000..71d41a6 --- /dev/null +++ b/checkAutoPath.tcl @@ -0,0 +1,17 @@ +# This file checks that the directory where TclCurl is going to be +# installed is actually in the auto_path variable, if it isn't it +# modifies 'init.tcl'. + +set tclCurlDir [lindex $argv 0] +set initTclDir [lindex $argv 1] +set initFile [file join $tcl_library init.tcl] +if {[file writable $initFile]==0} exit + + +if {[lsearch $auto_path $tclCurlDir]==-1} { + set handle [open "$initFile" a] + puts $handle "\nlappend auto_path $tclCurlDir\n" +} + +exit +