mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-12 08:49:02 +08:00
Added --ignore-nonexistent-config to allow integration with Pronterface even if config file doesn't exist
This commit is contained in:
parent
caf41f07dd
commit
fcb7f63c87
@ -188,9 +188,11 @@ Put this into *slicecommand*:
|
|||||||
|
|
||||||
And this into *sliceoptscommand*:
|
And this into *sliceoptscommand*:
|
||||||
|
|
||||||
slic3r.pl --load config.ini
|
slic3r.pl --load config.ini --ignore-nonexistent-config
|
||||||
|
|
||||||
Replace `slic3r.pl` with the full path to the slic3r executable.
|
Replace `slic3r.pl` with the full path to the slic3r executable and `config.ini`
|
||||||
|
with the full path of your config file (put it in your home directory or where
|
||||||
|
you like).
|
||||||
On Mac, the executable has a path like this:
|
On Mac, the executable has a path like this:
|
||||||
|
|
||||||
/Applications/Slic3r.app/Contents/MacOS/slic3r
|
/Applications/Slic3r.app/Contents/MacOS/slic3r
|
||||||
|
@ -24,6 +24,7 @@ my %cli_options = ();
|
|||||||
|
|
||||||
'save=s' => \$opt{save},
|
'save=s' => \$opt{save},
|
||||||
'load=s' => \$opt{load},
|
'load=s' => \$opt{load},
|
||||||
|
'ignore-nonexistent-config' => \$opt{ignore_nonexistent_config},
|
||||||
);
|
);
|
||||||
foreach my $opt_key (keys %$Slic3r::Config::Options) {
|
foreach my $opt_key (keys %$Slic3r::Config::Options) {
|
||||||
my $opt = $Slic3r::Config::Options->{$opt_key};
|
my $opt = $Slic3r::Config::Options->{$opt_key};
|
||||||
@ -36,8 +37,11 @@ my %cli_options = ();
|
|||||||
|
|
||||||
# load configuration
|
# load configuration
|
||||||
if ($opt{load}) {
|
if ($opt{load}) {
|
||||||
-e $opt{load} or die "Cannot find specified configuration file.\n";
|
if (-e $opt{load}) {
|
||||||
Slic3r::Config->load($opt{load});
|
Slic3r::Config->load($opt{load});
|
||||||
|
} else {
|
||||||
|
$opt{ignore_nonexistent_config} or die "Cannot find specified configuration file.\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# validate command line options
|
# validate command line options
|
||||||
|
Loading…
x
Reference in New Issue
Block a user