forked from panda3d/panda3d
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathctmkdir
More file actions
55 lines (47 loc) · 1.3 KB
/
ctmkdir
File metadata and controls
55 lines (47 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/perl
sub CTMkDirUsage {
print STDERR "Usage: ctmkdir [-c \"comment\"] [-nc] dir-name [...]\n" ;
print STDERR "Options:\n" ;
print STDERR " -c \"comment\" : provide a comment about this action\n" ;
print STDERR " -nc : expect no comment on this action\n" ;
exit ;
}
if ( $#ARGV < 0 ) {
&CTMkDirUsage ;
}
$tool = $ENV{"DTOOL"} ;
if ( $tool eq "" ) {
die "Environment not configured for CTtools" ;
}
require "$tool/built/include/ctutils.pl" ;
require "$tool/built/include/ctvspec.pl" ;
require "$tool/built/include/ctquery.pl" ;
require "$tool/built/include/ctproj.pl" ;
require "$tool/built/include/ctcm.pl" ;
$comment = "" ;
if ( $ARGV[0] eq "-nc" ) {
shift( @ARGV ) ;
&CTUDebug( "-nc processed\n" ) ;
}
if ( $ARGV[0] eq "-c" ) {
shift( @ARGV ) ;
$comment = $ARGV[0] ;
shift( @ARGV ) ;
&CTUDebug( "setting comment to '" . $comment . "'\n" ) ;
}
if ( $#ARGV < 0 ) {
&CTMkDirUsage ;
}
$projname = &CTProj ;
$projname =~ tr/A-Z/a-z/ ;
$flav = &CTQueryProj( $projname ) ;
$spec = &CTResolveSpec( $projname, $flav ) ;
foreach $item ( @ARGV ) {
if ( -e $item ) {
print STDERR "Name collision on directory '$item'\n" ;
} else {
if ( ! &CTCMMkdir( $item, $projname, $spec, $comment ) ) {
print STDERR "Could name make directory '$item'\n" ;
}
}
}