summaryrefslogtreecommitdiff
path: root/IkiWiki/Setup.pm
blob: 235e93eafa061219e96736787273106ee6a32225 (plain)
  1. #!/usr/bin/perl
  2. use warnings;
  3. use strict;
  4. use IkiWiki;
  5. use open qw{:utf8 :std};
  6. package IkiWiki;
  7. sub setup () { # {{{
  8. my $setup=possibly_foolish_untaint($config{setup});
  9. delete $config{setup};
  10. #translators: The first parameter is a filename, and the second
  11. #translators: is a (probably not translated) error message.
  12. open (IN, $setup) || error(sprintf(gettext("cannot read %s: %s"), $setup, $!));
  13. my $code;
  14. {
  15. local $/=undef;
  16. $code=<IN>;
  17. }
  18. ($code)=$code=~/(.*)/s;
  19. close IN;
  20. eval $code;
  21. error("$setup: ".$@) if $@;
  22. exit;
  23. } #}}}
  24. 1