Subversion Repositories Koakuma

Rev

Rev 3 | Rev 5 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3 Rev 4
Line 1... Line 1...
1
#!/usr/bin/env tclsh
1
#!/usr/bin/env tclsh
2
# $Id$
2
# $Id$
-
 
3
set RPC_URL "http://127.0.0.1/koakuma/rpc"
-
 
4
foreach arg $argv {
-
 
5
	if { [string range "$arg" 0 0] == "-" } {
-
 
6
		if { "$arg" == "-h" || "$arg" == "--help" } {
-
 
7
			puts "Usage: create-project"
-
 
8
			puts "You can set the environment variable `KOAKUMA_RPC' to override default RPC URL."
-
 
9
			puts "Default: $RPC_URL"	
-
 
10
			exit 0
-
 
11
		}
-
 
12
	}
-
 
13
}
-
 
14
foreach path [glob "@@PREFIX@@/lib/koakuma/utility/*.tcl"] {
-
 
15
	source $path
-
 
16
}
-
 
17
if { [info exists "env(KOAKUMA_RPC)"] } {
-
 
18
	set RPC_URL "$env(KOAKUMA_RPC)"
-
 
19
}
-
 
20
puts -nonewline "Authentication: "
-
 
21
set status [::rpc::require-auth]
-
 
22
if { $status == 1 } {
-
 
23
	puts "Required"
-
 
24
	if { ![::rpc::ask-auth] } {
-
 
25
		puts "Authentication failure"
-
 
26
		exit 1
-
 
27
	}
-
 
28
} elseif { $status < 0 } {
-
 
29
	puts "Got forbidden, cannot continue"
-
 
30
	exit 1
-
 
31
} else {
-
 
32
	puts "Not required"
-
 
33
}
-
 
34
::rpc::send