Skip to content

Commit

Permalink
fix(install): remove custom files
Browse files Browse the repository at this point in the history
  • Loading branch information
frankiejol committed Apr 22, 2024
1 parent bfebe76 commit 2ad3fe4
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions deb/debianize.pl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

use Carp qw(confess);
use Cwd qw(getcwd);
use Data::Dumper;
use File::Path qw(remove_tree make_path);
use IPC::Run3;
use lib './lib';
Expand Down Expand Up @@ -93,6 +94,32 @@ sub remove_not_needed {
die "Missing $path" if ! -e $path;
remove_tree($path);
}
remove_custom_files("public/js/custom");
}

sub remove_custom_files {
my $dir = shift;
opendir my $ls,$dir or die "$! $dir";
while ( my $file = readdir $ls) {
next if $file =~ m/^\.+$/;
my $path = "$dir/$file";
if ( -d $path ) {
die "Error: no dirs should be in $dir";
} elsif ( -f $path ) {
if ($file !~ /insert_here/) {
my ($dir_dst, $component) = $dir =~ m{(.*)/(.*)};
die "Unknown dir $dir " if !exists $DIR{$dir_dst};
my $deb_path = "$DIR_DST/$DIR{$dir_dst}/$component/$file";
if (! -e $deb_path ) {
($component) = $dir =~ m{.*/(\w+/\w+)};
$deb_path = "$DIR_DST/$DIR{$dir_dst}/$component/$file";
}
unlink $deb_path or die "$! $deb_path";
}
} else {
warn "Warning: unknown file type $file (neither file nor dir)";
}
}
}

sub create_md5sums {
Expand Down

0 comments on commit 2ad3fe4

Please sign in to comment.