[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-commits] master 393cd36 2/3: MakeProfiles deletes merged image
From: |
Mohammad Akhlaghi |
Subject: |
[gnuastro-commits] master 393cd36 2/3: MakeProfiles deletes merged image if it already exists |
Date: |
Mon, 5 Jun 2017 09:53:27 -0400 (EDT) |
branch: master
commit 393cd3681a300a3cc77a4836a8136458e75cffee
Author: Mohammad Akhlaghi <address@hidden>
Commit: Mohammad Akhlaghi <address@hidden>
MakeProfiles deletes merged image if it already exists
By default, MakeProfiles (like all Gnuastro programs), must delete its
outputs if they already exist. However, MakeProfiles was not doing that for
its merged images. It was doing it for the individual profiles, but not the
merged image. With this commit, the merged image file is also deleted if it
already exists.
---
bin/mkprof/ui.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/bin/mkprof/ui.c b/bin/mkprof/ui.c
index 25b622a..52f2c6e 100644
--- a/bin/mkprof/ui.c
+++ b/bin/mkprof/ui.c
@@ -308,6 +308,11 @@ ui_check_options_and_arguments(struct mkprofparams *p)
free(tmpname);
}
p->basename=gal_checkset_not_dir_part(p->mergedimgname);
+
+ /* If a merged image is requested, then delete it if it exists. */
+ if(p->nomerged==0)
+ gal_checkset_check_remove_file(p->mergedimgname, p->cp.keep,
+ p->cp.dontdelete);
}