Debian Codegraph @

IkiWiki/Setup/HostingAutomator.pm

raw
1 #!/usr/bin/perl
2 package IkiWiki::Setup::HostingAutomator;
3
4 use warnings;
5 use strict;
6 use YAML;
7
8 sub import {
9 my $class=shift;
10 my $setup=shift;
11
12 # Expand embedded $ENV{foo}, escaping single quotes for YAML.
13 $setup=~s{\$ENV\{(.*?)\}}{
14 my $v=$ENV{$1};
15 $v=~s/\n//g; # should never have newlines
16 $v=~s/'/''/g;
17 $v;
18 }eg;
19
20 require IkiWiki::Setup::Automator;
21 IkiWiki::Setup::Automator->import(%{Load($setup)});
22 }
23
24 1