Skip to content

postimp_navi script fails with --gwclump flag because of inconsistent current working directory #66

@beeemT

Description

@beeemT

When executing the postimp_navi script with the --gwclump flag here

ricopili/rp_bin/postimp_navi

Lines 4579 to 4580 in 757fb9d

if ($gwclump) {
chdir "$distdir";

the current working directory is changed to $distdir.
However the $numbers_script is then later executed in the $distdir as it does not change to a different directory itself.

ricopili/rp_bin/postimp_navi

Lines 4635 to 4648 in 757fb9d

my $numbers_file = "basic.$outname.num.xls";
unless (-e "$distdir/$numbers_file") {
my $sys = "$numbers_script basic.$outname $daner_all @daner_single";
# print "####################################### DEBUG ###############\n";
# print "$sys\n";
# print "$numbers_file\n";
# print "####################################### DEBUG ###############\n";
# sleep (4);
&mysystem ($sys);
&mysystem ("cp $numbers_file $distdir");
}

This is a problem because the $numbers_script (more specifically the arguments as these are paths to files) expect to still be in $reportdir. This makes the $numbers_script fail because it cannot find the files it was given as arguments.
I propose always executing chdir "$reportdir"; like this:
`my $numbers_file = "basic.$outname.num.xls";

unless (-e "$distdir/$numbers_file") {

chdir "$reportdir";

my $sys = "$numbers_script basic.$outname $daner_all @daner_single\n";`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions