Skip to content

Commit

Permalink
Fix issue where VSCode makefile extension can delete files
Browse files Browse the repository at this point in the history
The problem is that VSCode's make extension, in order to determine
some information about the project, runs
```
make --dry-run --always-make
```
which despite its name will actually try to remake the configure/*
files. Running `installEpics.pl` on these will delete them first,
then try copy them, resulting in an error.
  • Loading branch information
simon-ess committed Feb 14, 2024
1 parent 07cbf00 commit d932ef4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/tools/installEpics.pl
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
use Getopt::Std;
use File::Path;
use File::Copy;
use Cwd 'abs_path';

my $tool = basename($0);
my $mode = 0755;
Expand Down Expand Up @@ -57,6 +58,9 @@
my $temp = "$install_dir/TEMP.$name.$$";
my $target = "$install_dir/$name";

# Don't try to install the file if it already exists
next if abs_path($source) eq abs_path($target);

if (-f $target) {
next if -M $target < -M $source and -C $target < -C $source;
# Remove old target, making sure it is deletable first
Expand Down

0 comments on commit d932ef4

Please sign in to comment.