-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwalk.pl
More file actions
62 lines (48 loc) · 1.38 KB
/
walk.pl
File metadata and controls
62 lines (48 loc) · 1.38 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
56
57
58
59
60
61
#!/usr/bin/perl
; $walk::VERSION = '0.01'
# ***********************
; use strict; use warnings; use utf8
; use lib 'lib/'
; use dIngle::Application
; use Cwd qw/getcwd/
; use File::chdir
; use Data::Dumper
; use File::Spec ()
; use dIngle
; use Getopt::Std::Strict 'P:B:rhL'
; die <<__USAGE__
$0 [-P projectname] [-B project basedir]
-L -- use log4perl for logging
-r -- (re)initialize project
-h -- this help
__USAGE__
if $OPT{h}
; BEGIN
{ $dIngle::LOGGING = 'Log::Log4Perl' if $OPT{'L'}
}
; use dIngle::Project
; my $project_name = $OPT{'P'} || do { local $_ = $0; s/\..*//; $_ }
; my $base_dir = $OPT{'B'} || File::Spec->catdir(getcwd(), 'scheme',$project_name)
; my ($project)
; $project = new dIngle::Project::($project_name)
; $project->basedir($project_name =~ /^dingle/ ? getcwd() : $base_dir)
; print "new project basedir: " . $project->basedir, "\n"
; eval
{ local $CWD = $project->basedir
; $project->load_config
; $project->load_modules
}
; if($@)
{
; require dIngle::Starter::Plan
; my $plan = dIngle::Starter::Plan->new
; $plan->plan($project)
; print "Start " . $plan->project . "\n";
; $plan->work
}
; print $project->name . "\n"
; print $project->configuration->instance , "\n"
; print "".$project->namespace , "\n"
; print "Modules:\n\t", join "\n\t",$project->list_modules
; print "\n"
#; print Dumper($project)