Subversion Repositories Koakuma

Rev

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

Rev 8 Rev 11
Line 1... Line 1...
1
#!/usr/bin/env tclsh
1
#!/usr/bin/env tclsh
2
# $Id: create-project.in 8 2024-10-01 23:05:34Z nishi $
2
# $Id: create-project.in 11 2024-10-02 00:56:50Z nishi $
3
package require tdom
3
package require tdom
4
foreach arg $argv {
4
foreach arg $argv {
5
	if { [string range "$arg" 0 0] == "-" } {
5
	if { [string range "$arg" 0 0] == "-" } {
6
		if { "$arg" == "-h" || "$arg" == "--help" } {
6
		if { "$arg" == "-h" || "$arg" == "--help" } {
7
			puts "Usage: create-project"
7
			puts "Usage: create-project"
Line 12... Line 12...
12
	}
12
	}
13
}
13
}
14
foreach path [glob "@@PREFIX@@/lib/koakuma/utility/*.tcl"] {
14
foreach path [glob "@@PREFIX@@/lib/koakuma/utility/*.tcl"] {
15
	source $path
15
	source $path
16
}
16
}
17
puts -nonewline "Authentication: "
-
 
18
set status [::rpc::require-auth]
-
 
19
if { $status == 1 } {
-
 
20
	puts "Required"
-
 
21
	if { ![::rpc::ask-auth] } {
-
 
22
		puts "Authentication failure"
-
 
23
		exit 1
-
 
24
	}
17
 
25
} elseif { $status < 0 } {
-
 
26
	puts "Got forbidden, cannot continue"
-
 
27
	exit 1
18
::rpc::init
28
} else {
-
 
29
	puts "Not required"
-
 
30
}
-
 
31
 
19
 
32
dom createNodeCmd -tagName "name" -jsonType NONE elementNode keyName
20
dom createNodeCmd -tagName "name" -jsonType NONE elementNode keyName
33
dom createNodeCmd -tagName "description" -jsonType NONE elementNode keyDescription
21
dom createNodeCmd -tagName "description" -jsonType NONE elementNode keyDescription
34
dom createNodeCmd -tagName "vcs" -jsonType NONE elementNode keyVCS
22
dom createNodeCmd -tagName "vcs" -jsonType NONE elementNode keyVCS
35
dom createNodeCmd -tagName "url" -jsonType NONE elementNode keyURL
23
dom createNodeCmd -tagName "url" -jsonType NONE elementNode keyURL
Line 46... Line 34...
46
}
34
}
47
 
35
 
48
ask_for "Name" name
36
ask_for "Name" name
49
ask_for "Description" description
37
ask_for "Description" description
50
ask_for "VCS" vcs
38
ask_for "VCS" vcs
-
 
39
puts "Example URL for CVS: pserver://anon:@cvs.nishi.boats/cvs/nishi@tewi"
-
 
40
puts "Example URL for CVS: ssh://anoncvs:anoncvs@cvs.nishi.boats/cvs/nishi@tewi"
51
ask_for "VCS URL" url
41
ask_for "VCS URL" url
52
 
42
 
53
$doc appendFromScript {
43
$doc appendFromScript {
54
	keyName {valueString "$name"}
44
	keyName {valueString "$name"}
55
	keyDescription {valueString "$description"}
45
	keyDescription {valueString "$description"}