]> git.sven.stormbind.net Git - sven/tclcurl.git/blobdiff - checkAutoPath.tcl
Imported Upstream version 7.19.6
[sven/tclcurl.git] / checkAutoPath.tcl
diff --git a/checkAutoPath.tcl b/checkAutoPath.tcl
new file mode 100755 (executable)
index 0000000..71d41a6
--- /dev/null
@@ -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
+