Changeset 24
- Timestamp:
- 12/15/06 13:54:48 (2 years ago)
- Files:
-
- trunk/bin/kwiki (modified) (3 diffs)
- trunk/core/Kwiki/kwiki (deleted)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/bin/kwiki
r22 r24 8 8 use Config; 9 9 10 sub valid_base {11 my $base = shift;12 -d $base and13 -d "$base/core/Kwiki" and14 -d "$base/plugins";15 }16 17 10 sub find_base { 18 11 return $ENV{KWIKI_BASE} 19 12 if defined $ENV{KWIKI_BASE}; 13 20 14 my $base = $FindBin::Bin; 21 15 my $bin = $0; … … 28 22 } 29 23 $base = abs_path("$base/.."); 30 return $base if valid_base($base); 24 return $base if -d "$base/lib/Kwiki"; 25 26 if ($ENV{HOME}) { 27 $base = abs_path("$ENV{HOME}/.kwiki"); 28 return $base 29 if (-d $base and -w $base); 30 } 31 31 32 die <<'...'; 32 Can't locate Kwiki repository. 33 Try setting the KWIKI_BASE environment variable. 33 34 *ERROR*: Can't locate Kwiki base repository. 35 36 Try setting the KWIKI_BASE environment variable to a writable directory 37 where Kwiki can store site information. Alternately you can create a 38 ~/.kwiki/ directory for this purpose. 39 40 If you install Kwiki from SVN (http://svn.2.kwiki.org/kwiki/trunk/) or 41 from a Kwiki download tarball (instead of CPAN), then Kwiki will use 42 that directory as the base. 43 44 NOTE: Installing Kwiki from SVN is recommended. It makes installing and 45 updating Kwiki trivial. 46 34 47 ... 35 48 } 36 49 50 # Add $KWIKI_BASE/lib to @INC; 37 51 BEGIN { 38 my $base = find_base(); 39 die "$base is an invalid Kwiki source code repository" 40 unless valid_base($base); 41 eval "use lib '$base/lib'; 1" 42 or die $@; 43 # $ENV{KWIKI_TEST} = 1; 52 $ENV{KWIKI_TEST} = 1; 44 53 if ($ENV{KWIKI_TEST}) { 45 54 @INC = ( 46 "$base/lib",47 55 $Config::Config{privlib}, 48 56 $Config::Config{archlib}, 49 57 ); 58 } 59 60 my $base = find_base(); 61 if (-e "$base/lib") { 62 eval "use lib '$base/lib'; 1" 63 or die $@; 50 64 } 51 65 $ENV{KWIKI_BASE} = $base; … … 60 74 =head1 NAME 61 75 62 kwiki - The Kwiki Command Line Tool for Checked Out Code76 kwiki - The Kwiki Command Line Tool 63 77 64 78 =head1 USAGE 65 79 66 > # Get the source code and put 'kwiki' in your path 67 > svn co http://svn.kwiki.org/kwiki ~/src/kwiki 68 > export PATH=$PATH:~/src/kwiki/bin 80 > kwiki -new /path/to/cgi-bin/my-kwiki 69 81 70 > # Make a new Kwiki site 71 > mkdir ~/kwiki 72 > cd ~/kwiki 73 > kwiki -new my-first-kwiki 74 > cd my-first-kwiki 75 > kwiki -update 82 Kwiki software installed! Point your browser at this location. 76 83 77 84 =head1 DESCRIPTION 78 85 79 This script does the same thing as the C<kwiki> command line program 80 that is normally installed when you install C<Kwiki.pm> from CPAN. 86 Kwiki is a simple extendable wiki framework, written in Perl. 81 87 82 Use this script instead, when you are getting the Kwiki related modules 83 from C<http://svn.kwiki.org/kwiki/> instead of CPAN. 88 See L<Kwiki::Command> for more information on using this command line tool. 89 90 =head1 NOTE 91 92 If you are on Mac OS X, use the command C<perldoc Kwiki.pm> to get the 93 Kwiki B<module> documentation. 84 94 85 95 =head1 AUTHOR 86 96 87 Brian Ingerson<ingy@cpan.org>97 Ingy döt Net <ingy@cpan.org> 88 98 89 99 =head1 COPYRIGHT 90 100 91 Copyright (c) 2005. Brian Ingerson. All rights reserved. 101 Copyright (c) 2004-2005. Brian Ingerson. All rights reserved. 102 Copyright (c) 2006. Ingy döt Net. All rights reserved. 92 103 93 104 This program is free software; you can redistribute it and/or modify it
