mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-18 19:12:17 +00:00
Allow to supply custom G-code via command line if file is not found
This commit is contained in:
@@ -1071,13 +1071,13 @@ sub new_from_cli {
|
|||||||
for (qw(start end layer toolchange)) {
|
for (qw(start end layer toolchange)) {
|
||||||
my $opt_key = "${_}_gcode";
|
my $opt_key = "${_}_gcode";
|
||||||
if ($args{$opt_key}) {
|
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})
|
||||||
Slic3r::open(\my $fh, "<", $args{$opt_key})
|
or die "Failed to open $args{$opt_key}\n";
|
||||||
or die "Failed to open $args{$opt_key}\n";
|
binmode $fh, ':utf8';
|
||||||
binmode $fh, ':utf8';
|
$args{$opt_key} = do { local $/; <$fh> };
|
||||||
$args{$opt_key} = do { local $/; <$fh> };
|
close $fh;
|
||||||
close $fh;
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user