Skip to content

Commit

Permalink
Better detection of slicer dir and error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
theophile committed Jan 1, 2024
1 parent d49a7cd commit 6d813a6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions superslicer_to_orca.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1260,7 +1260,9 @@ sub handle_physical_printer {
my $file = basename( $input_file->basename, ".ini" );

if ( !defined $status{value}{physical_printer} ) {
if ( -d $status{dirs}{slicer}->subdir('physical_printer') ) {
if ( defined $status{dirs}{slicer}
&& -d $status{dirs}{slicer}->subdir('physical_printer') )
{
my $item_dir = $status{dirs}{slicer}->subdir('physical_printer');
my @items = $item_dir->children(qr/\.ini$/);
my @item_names = map { basename( $_, '.ini' ) } @items;
Expand All @@ -1278,7 +1280,7 @@ sub handle_physical_printer {
$status{value}{physical_printer} =
file( $item_dir, $status{value}{physical_printer} . '.ini' );
}

ask_yes_to_all( 'physical_printer', $file );

}
Expand Down Expand Up @@ -1364,6 +1366,10 @@ sub ini_reader {
map { s/^\s+|\s+$//gr } split /\s* = \s*/, $line, 2;
$config{$key} = $value;
}
if ( defined $status{slicer_flavor} ) {
$status{dirs}{slicer} =
$status{dirs}{data}->subdir( $status{slicer_flavor} );
}
return %config;
}

Expand Down

1 comment on commit 6d813a6

@theophile
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes #23

Please sign in to comment.