Ignore:
Timestamp:
Jun 17, 2007, 4:13:47 PM (14 years ago)
Author:
Dominic Hargreaves
Message:

Add support for installing static files (fixes #213)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/OpenGuides/Build.pm

    r1028 r1088  
    6060    my $custom_template_path = $config->custom_template_path;
    6161    my $custom_lib_path      = $config->custom_lib_path;
     62    my $static_path          = $config->static_path;
    6263    my @extra_scripts        = @{ $self->config_data( "__extra_scripts" ) };
    6364    my @templates            = @{ $self->config_data( "__templates" ) };
     65    my @static_files         = @{ $self->config_data( "__static_files" ) };
    6466
    6567    print "Installing scripts to $install_directory:\n";
     
    140142        if ( $FAKE ) {
    141143            print "templates/$template -> $template_path/$template (FAKE)\n";
    142         } else {
    143             $self->copy_if_modified(from => "templates/$template", to_dir => $template_path, flatten => 1)
     144            } else {
     145                $self->copy_if_modified(from => "templates/$template", to_dir => $template_path, flatten => 1)
    144146                or print "Skipping $template_path/$template (unchanged)\n";
    145147        }
     
    151153            print "Creating directory $custom_template_path.\n";
    152154            mkdir $custom_template_path or warn "Could not make $custom_template_path";
     155        }
     156    }
     157
     158    print "Installing static files to $static_path:\n";
     159    foreach my $static_file ( @static_files ) {
     160        if ( $FAKE ) {
     161            print "static/$static_file -> $static_path/$static_file (FAKE)\n";
     162        } else {
     163            $self->copy_if_modified(from => "static/$static_file", to_dir => $static_path, flatten => 1)
     164                or print "Skipping $static_path/$static_file (unchanged)\n";
    153165        }
    154166    }
Note: See TracChangeset for help on using the changeset viewer.