Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 36ee13c

Browse files
committed
Change working directory to location of builddocs.pl so that build will work under travis-ci .
1 parent b828871 commit 36ee13c

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

docsource/builddocs.pl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,21 @@
66
use Markdent::Simple::Fragment;
77
use File::Map qw(map_file);
88
use File::Path qw(make_path);
9+
use Cwd 'abs_path';
910

1011
use constant false => 0;
1112
use constant true => 1;
1213

1314
main();
1415

1516
sub main{
17+
# change current working directory to location of script.
18+
# this keeps realative paths later in script easier to maintain.
19+
# Source: https://sysengineers.wordpress.com/2009/12/04/changing-working-directory-to-script-location-in-perl/
20+
my $path = abs_path($0);
21+
$path =~ s/builddocs.pl//gi;
22+
chdir ($path);
23+
1624
# Create output directories if the don't exists
1725
make_path("../docs");
1826

0 commit comments

Comments
 (0)