mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-12 09:49:02 +08:00
Allow to supply custom G-code via command line if file is not found
This commit is contained in:
parent
2d687cd0a0
commit
8ea4ed3b5e
@ -1071,8 +1071,7 @@ sub new_from_cli {
|
||||
for (qw(start end layer toolchange)) {
|
||||
my $opt_key = "${_}_gcode";
|
||||
if ($args{$opt_key}) {
|
||||
die "Invalid value for --${_}-gcode: file does not exist\n"
|
||||
if !-e $args{$opt_key};
|
||||
if (-e $args{$opt_key}) {
|
||||
Slic3r::open(\my $fh, "<", $args{$opt_key})
|
||||
or die "Failed to open $args{$opt_key}\n";
|
||||
binmode $fh, ':utf8';
|
||||
@ -1080,6 +1079,7 @@ sub new_from_cli {
|
||||
close $fh;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$args{$_} = $Options->{$_}{deserialize}->($args{$_})
|
||||
for grep exists $args{$_}, qw(print_center bed_size duplicate_grid extruder_offset retract_layer_change wipe);
|
||||
|
Loading…
x
Reference in New Issue
Block a user