Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
beeemT opened this issue Sep 10, 2019 · 0 comments

Comments

@beeemT
Copy link

beeemT commented Sep 10, 2019

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";`
beeemT added a commit to beeemT/ricopili that referenced this issue Sep 26, 2019
beeemT added a commit to beeemT/ricopili that referenced this issue Sep 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant